aws-s3: Bucket with notifications has a delete stack race condition #23656
Labels
@aws-cdk/aws-s3
Related to Amazon S3
bug
This issue is a bug.
closed-for-staleness
This issue was automatically closed because it hadn't received any attention in a while.
p2
response-requested
Waiting on additional info and feedback. Will move to "closing-soon" in 7 days.
Describe the bug
When you define a Bucket resource and attach notifications to it (using the
Custom::S3BucketNotifications
resource under the hood) then try to delete the whole stack, it can sometimes (often) get into a race condition where the bucket delete and final put_bucket_notification_configuration call conflict.A picture is worth 1000 words.
Expected Behavior
The stack can be deleted successfully.
Current Behavior
The delete fails. See image above.
If you click delete again, it succeeds the second time.
Reproduction Steps
The code above is programmatically generated and cannot be shared. The crux of the issue is however to:
Possible Solution
Make the function dependant on the bucket, so that Cloudformation will delete the function before the bucket in every situation.
Additional Information/Context
No response
CDK CLI Version
2.59.0
Framework Version
No response
Node.js Version
N/A
OS
N/A
Language
Python
Language Version
Python 3.10.9
Other information
No response
The text was updated successfully, but these errors were encountered: