diff --git a/packages/aws-cdk/lib/init-templates/app/fsharp/src/HelloCdk/HelloCdk.template.fsproj b/packages/aws-cdk/lib/init-templates/app/fsharp/src/HelloCdk/HelloCdk.template.fsproj
index ea00aa0e9970b..04435e9e1a9fd 100644
--- a/packages/aws-cdk/lib/init-templates/app/fsharp/src/HelloCdk/HelloCdk.template.fsproj
+++ b/packages/aws-cdk/lib/init-templates/app/fsharp/src/HelloCdk/HelloCdk.template.fsproj
@@ -15,6 +15,7 @@
+
diff --git a/packages/aws-cdk/lib/init-templates/app/fsharp/src/HelloCdk/HelloConstruct.fs b/packages/aws-cdk/lib/init-templates/app/fsharp/src/HelloCdk/HelloConstruct.fs
index 244fa722abc3a..a456d6d5cec92 100644
--- a/packages/aws-cdk/lib/init-templates/app/fsharp/src/HelloCdk/HelloConstruct.fs
+++ b/packages/aws-cdk/lib/init-templates/app/fsharp/src/HelloCdk/HelloConstruct.fs
@@ -8,13 +8,10 @@ type HelloConstructProps = { BucketCount : int }
type HelloConstruct(parent, id, props) as this =
inherit Construct(parent, id)
- let mutable buckets = List.empty
-
- do
- buckets <- List.init props.BucketCount
+ let buckets =
+ List.init props.BucketCount
(fun i -> Bucket(this, "Bucket" + i.ToString(), BucketProps()))
- ()
member public __.GrantRead(principal) =
- List.iter
- (fun (bucket : Bucket) -> bucket.GrantRead(principal, "*")) buckets
+ buckets
+ |> List.iter (fun bucket -> bucket.GrantRead(principal, "*") |> ignore)
diff --git a/packages/aws-cdk/lib/init-templates/app/fsharp/src/HelloCdk/HelloStack.fs b/packages/aws-cdk/lib/init-templates/app/fsharp/src/HelloCdk/HelloStack.fs
index 2d74b09f2d4af..68c377ff4dec6 100644
--- a/packages/aws-cdk/lib/init-templates/app/fsharp/src/HelloCdk/HelloStack.fs
+++ b/packages/aws-cdk/lib/init-templates/app/fsharp/src/HelloCdk/HelloStack.fs
@@ -2,20 +2,20 @@ namespace HelloCdk
open HelloCdk
-open System
open Amazon.CDK
open Amazon.CDK.AWS.IAM
open Amazon.CDK.AWS.SNS
+open Amazon.CDK.AWS.SNS.Subscriptions
open Amazon.CDK.AWS.SQS
type MyStack(scope, id, props) as this =
inherit Stack(scope, id, props)
- let queue = Queue(this, "MyFirstQueue", QueueProps(VisibilityTimeout = Duration.Seconds(300)))
+ let queue = Queue(this, "MyFirstQueue", QueueProps(VisibilityTimeout = Duration.Seconds(300.)))
+
let topic = Topic(this, "MyFirstTopic", TopicProps(DisplayName = "My First Topic Yeah"))
+ do topic.AddSubscription(SqsSubscription(queue, null))
+
let hello = HelloConstruct(this, "Buckets", { BucketCount = 5 })
let user = User(this, "MyUser", UserProps())
-
- do
- topic.SubscribeQueue(queue, Nullable false) |> ignore
- hello.GrantRead(user)
+ do hello.GrantRead(user)