Last active
June 3, 2020 15:07
-
-
Save wbroek/4c9e6a6f252aa74230d9d26295dbb64b to your computer and use it in GitHub Desktop.
Amplify Storage S3 bucket public policy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"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