If I have a folder in a S3 bucket that contains many more folders, and I want to enable getObject public access to the object in all of those folders can I do something like?
{
"Id": "example123",
"Version": "2012-10-17",
"Statement": [
{
"Sid": "example123",
"Action": [
"s3:GetObject"
],
"Effect": "Allow",
"Resource": "arn:aws:s3:::bucket-name/next-level-folder/*/*",
"Principal": "*"
}
]
}
...where the first *
is all the folders and the second *
is all the objects in the folders?
I am going to have lots of folders that will require public access and don't want to have to write out the path for each one and put them in the resources e.g.
"Resource": ["arn:aws:s3:::bucket-name/next-level-folder/folder1/*",
"arn:aws:s3:::bucket-name/next-level-folder/folder2/*",
"arn:aws:s3:::bucket-name/next-level-folder/folder3/*",
]