-
Notifications
You must be signed in to change notification settings - Fork 4k
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_s3_notifications : CDK destroy deletes existing S3 event notifications #29004
Comments
We also had the same issue. We have multiple CDK stacks. When I tried to add or remove bucket notifications using the method you described (to a specific stack) it also removed all existing ones (not part of the stack). |
probably related to #28915 |
This is caused by 37be7b9#r137776660 |
having same issue here. |
…ication events (#29939) ### Issue # (if applicable) Closes #29004 ### Reason for this change `cdk destroy` removes all event notifications configured on an existing S3 bucket instead of only CDK managed event notifications. This occurs whenever a stack that creates an event notification for an existing bucket is deleted or rolled back. ### Description of changes Add a `Delete` statement which will only remove the ones created from within the stack ### Description of how you validated changes Manually tested this. ### Checklist - [ ] My code adheres to the [CONTRIBUTING GUIDE](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) and [DESIGN GUIDELINES](https://github.com/aws/aws-cdk/blob/main/docs/DESIGN_GUIDELINES.md) ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
|
Describe the bug
cdk destroy
removes all event notifications configured on an existing S3 bucket instead of only CDK managed event notifications. This occurs whenever a stack that creates an event notification for an existing bucket is deleted or rolled back.Expected Behavior
cdk destroy
or a rollback from a failed stack should only delete S3 event notifications created by the stackCurrent Behavior
cdk destroy
or a rollback from a failed stack removes all S3 event notifications on the bucketReproduction Steps
cdk deploy
the stackcdk destroy
the stackPossible Solution
The BucketNotificationHandler Lambda function described in #2004 appears to include handling for unmanaged event notifications. Modifying this function to support this scenario should resolve the issue.
Additional Information/Context
No response
CDK CLI Version
2.126.0 (build fb74c41)
Framework Version
No response
Node.js Version
v20.11.0
OS
macOS Ventura 13.6.4
Language
Python
Language Version
Python (3.9.7)
Other information
No response
The text was updated successfully, but these errors were encountered: