aws-cdk icon indicating copy to clipboard operation
aws-cdk copied to clipboard

aws-cdk-lib: NotificationARN must be passed by constructor to actually send notifications

Open michelececcacci opened this issue 2 years ago • 2 comments
trafficstars

Describe the issue

Spent quite a bit of time on this, thinking that i was doing something wrong. I thought that we could just push to the notificationARNs array, but turns out the cloudformation output isn't produced in the template. I had to pass the array from the constructor (as props) to make it work. I feel like this should be mentioned in the documentation, and i'm willing to submit a PR myself.

Links

https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.NestedStack.html

michelececcacci avatar Aug 13 '23 18:08 michelececcacci

can you explain more about your intention and provide your code snippet if possible?

pahud avatar Aug 14 '23 15:08 pahud

I can't share the code here, but basically i was trying to send notifications to a specific arn (my queue0. My first approach , was to push on the notificationARNs array. I assumed this would work, since the array contained the desired ARN (verified through unit test). The thing is, the actual cloudformation output didn't contain the actual ARN (no ARNs at all actually, since that was the only one i was passing). When i passed the array as a prop from the constructor, i reached the desired output.

michelececcacci avatar Aug 14 '23 19:08 michelececcacci