Skip to content

Commit 735b786

Browse files
authored
fix(s3): bucket deletion fails if object creation races against cleanup (#26875)
Adds a DENY policy for S3:PutObject on buckets to be auto-deleted to prevent a race condition on emptying with external bucket writers. As a new contributor, the requirements for integration testing were unclear to me. I have tested the policy on my own buckets and included unit tests, but am willing to work toward code compliance with assistance. Closes #26874. ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
1 parent 0c66a20 commit 735b786

File tree

303 files changed

+143925
-5187
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

303 files changed

+143925
-5187
lines changed

packages/@aws-cdk-testing/framework-integ/test/aws-cloudtrail/test/integ.cloudtrail-insight.js.snapshot/asset.2ec8ad9e91dcd6e7ad6a5c84ffc6c9c05c408aca3b26ceb2816d81043e6c4dc3/index.js

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/@aws-cdk-testing/framework-integ/test/aws-cloudtrail/test/integ.cloudtrail-insight.js.snapshot/asset.3e6ea85c994cf2198f02e67a9e98e8f23456efa8bd72dd55b3a86454c4db9d5f/index.js

-68
This file was deleted.

packages/@aws-cdk-testing/framework-integ/test/aws-cloudtrail/test/integ.cloudtrail-insight.js.snapshot/aws-cdk-cloudtrail-inshights-test.assets.json

+6-6
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/@aws-cdk-testing/framework-integ/test/aws-cloudtrail/test/integ.cloudtrail-insight.js.snapshot/aws-cdk-cloudtrail-inshights-test.template.json

+8-7
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@
2525
"Action": [
2626
"s3:DeleteObject*",
2727
"s3:GetBucket*",
28-
"s3:List*"
28+
"s3:List*",
29+
"s3:PutBucketPolicy"
2930
],
3031
"Effect": "Allow",
3132
"Principal": {
@@ -155,7 +156,7 @@
155156
"S3Bucket": {
156157
"Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}"
157158
},
158-
"S3Key": "3e6ea85c994cf2198f02e67a9e98e8f23456efa8bd72dd55b3a86454c4db9d5f.zip"
159+
"S3Key": "2ec8ad9e91dcd6e7ad6a5c84ffc6c9c05c408aca3b26ceb2816d81043e6c4dc3.zip"
159160
},
160161
"Timeout": 900,
161162
"MemorySize": 128,
@@ -187,10 +188,6 @@
187188
"Trail022F0CF2": {
188189
"Type": "AWS::CloudTrail::Trail",
189190
"Properties": {
190-
"IsLogging": true,
191-
"S3BucketName": {
192-
"Ref": "S3486F821D"
193-
},
194191
"EnableLogFileValidation": true,
195192
"EventSelectors": [],
196193
"IncludeGlobalServiceEvents": true,
@@ -202,7 +199,11 @@
202199
"InsightType": "ApiErrorRateInsight"
203200
}
204201
],
205-
"IsMultiRegionTrail": true
202+
"IsLogging": true,
203+
"IsMultiRegionTrail": true,
204+
"S3BucketName": {
205+
"Ref": "S3486F821D"
206+
}
206207
},
207208
"DependsOn": [
208209
"S3Policy2E4AA1D6"

packages/@aws-cdk-testing/framework-integ/test/aws-cloudtrail/test/integ.cloudtrail-insight.js.snapshot/awscdkcloudtrailinshightsDefaultTestDeployAssertF7B86FF0.assets.json

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/@aws-cdk-testing/framework-integ/test/aws-cloudtrail/test/integ.cloudtrail-insight.js.snapshot/cdk.out

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/@aws-cdk-testing/framework-integ/test/aws-cloudtrail/test/integ.cloudtrail-insight.js.snapshot/integ.json

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/@aws-cdk-testing/framework-integ/test/aws-cloudtrail/test/integ.cloudtrail-insight.js.snapshot/manifest.json

+4-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/@aws-cdk-testing/framework-integ/test/aws-cloudtrail/test/integ.cloudtrail-insight.js.snapshot/tree.json

+9-8
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/@aws-cdk-testing/framework-integ/test/aws-cloudtrail/test/integ.cloudtrail-supplied-bucket.lit.js.snapshot/asset.120f2d9f06d56bd1038e8bb4bc7fa0b1758f62b6c772f4ac166b811e9ed71cf9/index.js

-1
This file was deleted.

packages/@aws-cdk-testing/framework-integ/test/aws-cloudtrail/test/integ.cloudtrail-supplied-bucket.lit.js.snapshot/asset.2ec8ad9e91dcd6e7ad6a5c84ffc6c9c05c408aca3b26ceb2816d81043e6c4dc3/index.js

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)