Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Amplify Storage S3 bucket public policy
"S3BucketPolicy": {
"Type": "AWS::S3::BucketPolicy",
"Properties": {
"Bucket": {
"Fn::Join": [
"",
[
{ "Ref": "bucketName" },
{
"Fn::Select": [
3,
{
"Fn::Split": [
"-",
{
"Ref": "AWS::StackName"
}
]
}
]
},
"-",
{
"Ref": "env"
}
]
]
},
"PolicyDocument": {
"Statement": [
{
"Sid": "PublidReadGetObject",
"Effect": "Allow",
"Action": "s3:GetObject",
"Principal": "*",
"Resource": {
"Fn::Join": [
"",
[
"arn:aws:s3:::",
{ "Ref": "bucketName" },
{
"Fn::Select": [
3,
{
"Fn::Split": [
"-",
{
"Ref": "AWS::StackName"
}
]
}
]
},
"-",
{
"Ref": "env"
},
"/*"
]
]
}
}
]
}
}
},
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment