File tree Expand file tree Collapse file tree 3 files changed +11
-13
lines changed
packages/aws-cdk/lib/init-templates/app/fsharp/src/HelloCdk Expand file tree Collapse file tree 3 files changed +11
-13
lines changed Original file line number Diff line number Diff line change 15
15
<PackageReference Include =" Amazon.CDK" Version =" %cdk-version%-devpreview" />
16
16
<PackageReference Include =" Amazon.CDK.AWS.IAM" Version =" %cdk-version%-devpreview" />
17
17
<PackageReference Include =" Amazon.CDK.AWS.SNS" Version =" %cdk-version%-devpreview" />
18
+ <PackageReference Include =" Amazon.CDK.AWS.SNS.Subscriptions" Version =" %cdk-version%-devpreview" />
18
19
<PackageReference Include =" Amazon.CDK.AWS.SQS" Version =" %cdk-version%-devpreview" />
19
20
</ItemGroup >
20
21
Original file line number Diff line number Diff line change @@ -8,13 +8,10 @@ type HelloConstructProps = { BucketCount : int }
8
8
type HelloConstruct ( parent , id , props ) as this =
9
9
inherit Construct( parent, id)
10
10
11
- let mutable buckets = List.empty
12
-
13
- do
14
- buckets <- List.init props.BucketCount
11
+ let buckets =
12
+ List.init props.BucketCount
15
13
( fun i -> Bucket( this, " Bucket" + i.ToString(), BucketProps()))
16
- ()
17
14
18
15
member public __.GrantRead ( principal ) =
19
- List.iter
20
- ( fun ( bucket : Bucket ) -> bucket.GrantRead( principal, " *" )) buckets
16
+ buckets
17
+ |> List.iter ( fun bucket -> bucket.GrantRead( principal, " *" ) |> ignore )
Original file line number Diff line number Diff line change @@ -2,20 +2,20 @@ namespace HelloCdk
2
2
3
3
open HelloCdk
4
4
5
- open System
6
5
open Amazon.CDK
7
6
open Amazon.CDK .AWS .IAM
8
7
open Amazon.CDK .AWS .SNS
8
+ open Amazon.CDK .AWS .SNS .Subscriptions
9
9
open Amazon.CDK .AWS .SQS
10
10
11
11
type MyStack ( scope , id , props ) as this =
12
12
inherit Stack( scope, id, props)
13
13
14
- let queue = Queue( this, " MyFirstQueue" , QueueProps( VisibilityTimeout = Duration.Seconds( 300 )))
14
+ let queue = Queue( this, " MyFirstQueue" , QueueProps( VisibilityTimeout = Duration.Seconds( 300. )))
15
+
15
16
let topic = Topic( this, " MyFirstTopic" , TopicProps( DisplayName = " My First Topic Yeah" ))
17
+ do topic.AddSubscription( SqsSubscription( queue, null ))
18
+
16
19
let hello = HelloConstruct( this, " Buckets" , { BucketCount = 5 })
17
20
let user = User( this, " MyUser" , UserProps())
18
-
19
- do
20
- topic.SubscribeQueue( queue, Nullable false ) |> ignore
21
- hello.GrantRead( user)
21
+ do hello.GrantRead( user)
You can’t perform that action at this time.
0 commit comments