Skip to content

Commit

Permalink
fix(core): fix build errors in fsharp init-template (#3229)
Browse files Browse the repository at this point in the history
  • Loading branch information
mikhailshilkov authored and Elad Ben-Israel committed Jul 7, 2019
1 parent d6f5207 commit 7d020f1
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
<PackageReference Include="Amazon.CDK" Version="%cdk-version%-devpreview" />
<PackageReference Include="Amazon.CDK.AWS.IAM" Version="%cdk-version%-devpreview" />
<PackageReference Include="Amazon.CDK.AWS.SNS" Version="%cdk-version%-devpreview" />
<PackageReference Include="Amazon.CDK.AWS.SNS.Subscriptions" Version="%cdk-version%-devpreview" />
<PackageReference Include="Amazon.CDK.AWS.SQS" Version="%cdk-version%-devpreview" />
</ItemGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Original file line number Diff line number Diff line change
Expand Up @@ -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)

0 comments on commit 7d020f1

Please sign in to comment.