Articles → AWS → Folder-Wise Access In The AWS S3 Bucket
Folder-Wise Access In The AWS S3 Bucket
Scenario
Click to Enlarge
Create A User
Click to Enlarge
Create A Policy
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "sid1",
"Action": [
"s3:ListAllMyBuckets",
"s3:ListBucket"
],
"Effect": "Allow",
"Resource": [
"arn:aws:s3:::*"
]
},
{
"Sid": "sid2",
"Action": [
"s3:ListBucket"
],
"Effect": "Deny",
"Resource": [
"arn:aws:s3:::*"
],
"Condition": {
"StringEquals": {
"s3:prefix": [
"folder2/"
]
}
}
}
]
}
Output
Click to Enlarge
Click to Enlarge