Skip to content

Instantly share code, notes, and snippets.

@atrauzzi
Last active April 1, 2016 13:23
Show Gist options
  • Save atrauzzi/f5483d60875c47c60b1a to your computer and use it in GitHub Desktop.
Save atrauzzi/f5483d60875c47c60b1a to your computer and use it in GitHub Desktop.
Granting your app access to S3
<?xml version="1.0" encoding="UTF-8"?>
<CORSConfiguration xmlns="http://s3.amazonaws.com/doc/2006-03-01/">
<CORSRule>
<AllowedOrigin>*</AllowedOrigin>
<AllowedMethod>GET</AllowedMethod>
<MaxAgeSeconds>3000</MaxAgeSeconds>
<AllowedHeader>*</AllowedHeader>
</CORSRule>
</CORSConfiguration>
{
"Id": "GrantAppAccess",
"Statement": [
{
"Sid": "AppObjects",
"Effect": "Allow",
"Principal": {
"AWS": "[USER ARN]"
},
"Action": [
"s3:GetObjectAcl",
"s3:GetObject",
"s3:PutObject",
"s3:DeleteObject"
],
"Resource": "arn:aws:s3:::[BUCKET NAME]/*"
},
{
"Sid": "AppBucket",
"Effect": "Allow",
"Principal": {
"AWS": "[USER ARN]"
},
"Action": [
"s3:ListBucket"
],
"Resource": "arn:aws:s3:::[BUCKET NAME]"
},
{
"Sid": "AnonymousObjects",
"Effect": "Allow",
"Principal": "*",
"Action": "s3:GetObject",
"Resource": "arn:aws:s3:::[BUCKET NAME]/*"
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment