-
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
feat(s3): supports RemovalPolicy for BucketPolicy #8158
Conversation
Exposes RemovalPolicy on the BucketPolicyProps so bucket policies can be retained when a stack is deleted. I'm conflicted about this implementation, because it seems the more recommended way to create/associate policies with buckets is to use the addToResourcePolicy (or the grant*) methods. One option would be to have the addToResourcePolicy call set the removal policy on the bucket policy to whatever the policy is for the bucket itself; however, that would be a backwards-incompatible change, and so would need a feature flag. Curious for feedback from the core members on this approach. fixes #7415
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
@njlynch you mentioned:
Yeah, I wouldn't go down that road... Since the const bucket = new s3.Bucket(this, 'Bucket', {});
bucket.policy?.setRemovalPolicy(RemovalPolicy.DELETE); WDYT? |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
Thank you for contributing! Your pull request will be updated from master and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
Thank you for contributing! Your pull request will be updated from master and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
Exposes RemovalPolicy on the BucketPolicyProps so bucket policies can be
retained when a stack is deleted.
I'm conflicted about this implementation, because it seems the more recommended
way to create/associate policies with buckets is to use the addToResourcePolicy
(or the grant*) methods. One option would be to have the addToResourcePolicy
call set the removal policy on the bucket policy to whatever the policy is for
the bucket itself; however, that would be a backwards-incompatible change, and
so would need a feature flag.
Curious for feedback from the core members on this approach.
fixes #7415
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license