I’m trying to set up aws policy on a s3 bucket that has following structure:
s3://my-bucket/source-name/raw
s3://my-bucket/source-name/processed
s3://my-bucket/source-name/curated
Only part of the path that will change is source-name
. I want to set up my policy so that third party tool can access only to curated
folder for every source. I tried following policy but the StringLike
seems like doesn’t work this way.
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"s3:GetObject",
"s3:GetObjectVersion",
"s3:ListBucket",
"s3:GetBucketLocation"
],
"Resource": [
"arn:aws:s3:::my-bucket/*"
]
},
{
"Sid": "AllowOnlyCuratedFolder",
"Effect": "Allow",
"Action": "s3:ListBucket",
"Resource": "arn:aws:s3:::my-bucket",
"Condition": {
"StringLike": {
"s3:prefix": "curated"
}
}
}
]
}
Anyone has an idea how to set up this?