Last active
June 19, 2019 09:48
-
-
Save vicly/9655e9c59fa1c87bbd31b33726e3e8b5 to your computer and use it in GitHub Desktop.
[S3 - Grant access to user specific folder] #AWS
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"Version": "2012-10-17", | |
"Statement": [ | |
{ | |
"Sid": "AllowUserToSeeBucketListInTheConsole", | |
"Action": [ | |
"s3:ListAllMyBuckets", | |
"s3:GetBucketLocation" | |
], | |
"Effect": "Allow", | |
"Resource": [ | |
"arn:aws:s3:::*" | |
] | |
}, | |
{ | |
"Sid": "AllowRootAndHomeListingOfCompanyBucket", | |
"Action": [ | |
"s3:ListBucket" | |
], | |
"Effect": "Allow", | |
"Resource": [ | |
"arn:aws:s3:::vic-test-bucket" | |
], | |
"Condition": { | |
"StringEquals": { | |
"s3:prefix": [ | |
"", | |
"home/" | |
], | |
"s3:delimiter": [ | |
"/" | |
] | |
} | |
} | |
}, | |
{ | |
"Sid": "AllowListingOfUserFolder", | |
"Action": [ | |
"s3:ListBucket" | |
], | |
"Effect": "Allow", | |
"Resource": [ | |
"arn:aws:s3:::vic-test-bucket" | |
], | |
"Condition": { | |
"StringLike": { | |
"s3:prefix": [ | |
"home/${aws:username}/*" | |
] | |
} | |
} | |
}, | |
{ | |
"Sid": "AllowAllS3ActionsInUserFolder", | |
"Effect": "Allow", | |
"Action": [ | |
"s3:*" | |
], | |
"Resource": [ | |
"arn:aws:s3:::vic-test-bucket/home/${aws:username}/*" | |
] | |
} | |
] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment