BucketDeployment: retainOnDelete: false not working when stack deleted #33397
Labels
@aws-cdk/aws-s3
Related to Amazon S3
bug
This issue is a bug.
effort/medium
Medium work item – several days of effort
p2
Describe the bug
With this example stack I would expect the
BucketDeployment
to delete contents of the associated bucket when the stack is deleted becauseretainOnDelete
is set to false, allowing the bucket itself to be deleted. However the contents of the bucket are not deleted, and so the stack fails to delete because the bucket can't be deleted:Regression Issue
Last Known Working CDK Version
No response
Expected Behavior
I expected the contents of the bucket to be deleted to allow the stack to be deleted successfully
Current Behavior
The contents of the bucket are not deleted. In the logs for the underlying Custom Resource Lambda function I see this:
Reproduction Steps
See example in summary
Possible Solution
No response
Additional Information/Context
No response
CDK CLI Version
2.178.1 (build ae342cb)
Framework Version
No response
Node.js Version
22
OS
Mac OS 15
Language
TypeScript
Language Version
No response
Other information
No response
The text was updated successfully, but these errors were encountered: