Skip to content

Instantly share code, notes, and snippets.

@johanneslamers
Last active August 17, 2018 18:45
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save johanneslamers/c7a27bff9a7c8dd5bf90 to your computer and use it in GitHub Desktop.
Save johanneslamers/c7a27bff9a7c8dd5bf90 to your computer and use it in GitHub Desktop.
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"s3:ListAllMyBuckets",
"s3:PutObject",
"s3:PutObjectAcl"
],
"Resource": "arn:aws:s3:::*"
},
{
"Effect": "Allow",
"Action": "s3:*",
"Resource": "arn:aws:s3:::bucketname"
}
]
}
Finally, if you want the images to show up on the front-end, you need to add a bucket policy:
{
"Id": "PolicyXXXXXXXXXXXXXXX",
"Version": "2012-10-17",
"Statement": [
{
"Sid": "XXXXXXXXXXXXXXXX",
"Action": [
"s3:GetObject"
],
"Effect": "Allow",
"Resource": "arn:aws:s3:::bucketname/*",
"Principal": "*"
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment