Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

aws-cdk: NotificationArns as a construct prop, rather than read-only #21986

Closed
2 tasks
dzenana-s opened this issue Sep 9, 2022 · 4 comments
Closed
2 tasks
Labels
@aws-cdk/aws-sns Related to Amazon Simple Notification Service closed-for-staleness This issue was automatically closed because it hadn't received any attention in a while. feature-request A feature should be added or improved. response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days.

Comments

@dzenana-s
Copy link

Describe the feature

We are exploring how we can integrate SNS with our CloudFormation stacks. We noticed that you can supply a notificationArns prop, which can include an SNS topic ARN, but only on the NestedStack construct, not the Stack construct.

Is there a reason why this prop cannot be supplied when creating deploying with the CDK without nesting? We are trying to find a way to automate adding SNS, without manually making the update to the stack so that it points notifications to the SNS topic in the console.

Use Case

We would like to monitor changes to certain CloudFormation stacks and send notifications through SNS when certain actions are taken on a stack.

Currently, we would have to deploy via CDK and then manually update the notification settings in the stack, but we would like to do this all via code.

Proposed Solution

No response

Other Information

No response

Acknowledgements

  • I may be able to implement this feature request
  • This feature might incur a breaking change

CDK version used

2.35.0

Environment details (OS name and version, etc.)

Mac OS

@dzenana-s dzenana-s added feature-request A feature should be added or improved. needs-triage This issue or PR still needs to be triaged. labels Sep 9, 2022
@github-actions github-actions bot added the @aws-cdk/aws-sns Related to Amazon Simple Notification Service label Sep 9, 2022
@kaizencc
Copy link
Contributor

The reason is that NestedStack is built on top of the CfnStack cloudformation resource, which has the notificationArns property. A CDK Stack does not actually create a CfnStack afaik, so it doesn't have the opportunity to update the notificationArns property. How/why this is the case I'm not entirely sure; I did a little digging but came up with more questions than answers. Maybe @rix0rrr can help with answering that.

@kaizencc kaizencc added guidance Question that needs advice or information. and removed needs-triage This issue or PR still needs to be triaged. labels Sep 19, 2022
@kaizencc kaizencc removed their assignment Sep 19, 2022
@peterwoodworth
Copy link
Contributor

You can set the arns of SNS topics to notify on cdk deploy with the --notification-arns option.

@kaizencc you're right that Stack does not actually create a CfnStack - the CloudFormation::Stack resource is specifically for nested stacks. The way CDK accomplishes setting the notification arns on a non-nested stack is by passing them into the CreateChangeSet operation which is best configured through the CLI rather than the Stack construct, though I would think it's possible for us to design it such that it's configurable through the stack construct as well

@dzenana-s I hope configuring this through the CLI works for you! 🙂

@peterwoodworth peterwoodworth added response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days. and removed guidance Question that needs advice or information. labels Sep 19, 2022
@github-actions
Copy link

This issue has not received a response in a while. If you want to keep this issue open, please leave a comment below and auto-close will be canceled.

@github-actions github-actions bot added closing-soon This issue will automatically close in 4 days unless further comments are made. closed-for-staleness This issue was automatically closed because it hadn't received any attention in a while. and removed closing-soon This issue will automatically close in 4 days unless further comments are made. labels Sep 22, 2022
@gricey432
Copy link

For people like me who find this in search, see #8581

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
@aws-cdk/aws-sns Related to Amazon Simple Notification Service closed-for-staleness This issue was automatically closed because it hadn't received any attention in a while. feature-request A feature should be added or improved. response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days.
Projects
None yet
Development

No branches or pull requests

4 participants