Skip to content

Instantly share code, notes, and snippets.

@wbroek
Last active June 3, 2020 15:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wbroek/4c9e6a6f252aa74230d9d26295dbb64b to your computer and use it in GitHub Desktop.
Save wbroek/4c9e6a6f252aa74230d9d26295dbb64b to your computer and use it in GitHub Desktop.
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