aws_s3: Bucket with removal policy = retain lose resource policy on cdk destroy
#27125
Labels
@aws-cdk/aws-s3
Related to Amazon S3
bug
This issue is a bug.
effort/small
Small work item – less than a day of effort
p2
Describe the bug
Consider the following CDK app having a bucket that has
enforce_ssl=True
andremoval_policy=Retain
. Oncdk destroy
the bucket is retained, as expected, though the bucket resource policy is deleted.Expected Behavior
The bucket's resource policy is retained as well
Current Behavior
The bucket is retained, its resource policy is not.
Reproduction Steps
Deploy the abovementioned app
cdk deploy
Check the bucket resource policy, should contain the policy to disable non-SSL transport
Destroy the app
cdk destroy
Check the bucket is still there, the policy is gone
Possible Solution
No response
Additional Information/Context
No response
CDK CLI Version
2.93.0 (build 724bd01)
Framework Version
No response
Node.js Version
v18.14.2
OS
Fedora 36
Language
Python
Language Version
No response
Other information
No response
The text was updated successfully, but these errors were encountered: