Skip to content

Commit

Permalink
Merge branch 'master' into feature-lb-access-log
Browse files Browse the repository at this point in the history
  • Loading branch information
ramancloudsmartz authored Jun 7, 2021
2 parents 90fd0cd + f9be15d commit 51515f0
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 3 deletions.
3 changes: 2 additions & 1 deletion packages/@aws-cdk/aws-s3/lib/bucket.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1841,7 +1841,8 @@ export class Bucket extends BucketBase {
// objects in the bucket
this.addToResourcePolicy(new iam.PolicyStatement({
actions: [
...perms.BUCKET_READ_ACTIONS, // list objects
// list objects
...perms.BUCKET_READ_METADATA_ACTIONS,
...perms.BUCKET_DELETE_ACTIONS, // and then delete them
],
resources: [
Expand Down
5 changes: 5 additions & 0 deletions packages/@aws-cdk/aws-s3/lib/perms.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ export const BUCKET_READ_ACTIONS = [
's3:List*',
];

export const BUCKET_READ_METADATA_ACTIONS = [
's3:GetBucket*',
's3:List*',
];

export const LEGACY_BUCKET_PUT_ACTIONS = [
's3:PutObject*',
's3:Abort*',
Expand Down
1 change: 0 additions & 1 deletion packages/@aws-cdk/aws-s3/test/bucket.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2385,7 +2385,6 @@ describe('bucket', () => {
'Statement': [
{
'Action': [
's3:GetObject*',
's3:GetBucket*',
's3:List*',
's3:DeleteObject*',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
"Statement": [
{
"Action": [
"s3:GetObject*",
"s3:GetBucket*",
"s3:List*",
"s3:DeleteObject*"
Expand Down

0 comments on commit 51515f0

Please sign in to comment.