Skip to content

Instantly share code, notes, and snippets.

@devkhan
Last active October 21, 2016 19:27
Show Gist options
  • Save devkhan/6d8239406c67cbc70419b142598ddd95 to your computer and use it in GitHub Desktop.
Save devkhan/6d8239406c67cbc70419b142598ddd95 to your computer and use it in GitHub Desktop.
AWS S3 Bucket Policy
<?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>Authorization</AllowedHeader>
</CORSRule>
</CORSConfiguration>
{
"Version": "2008-10-17",
"Statement": [
{
"Sid": "PublicReadForGetBucketObjects",
"Effect": "Allow",
"Principal": {
"AWS": "*"
},
"Action": "s3:GetObject",
"Resource": "arn:aws:s3:::{BUCKET_NAME}/*"
},
{
"Effect": "Allow",
"Principal": {
"AWS": "arn:aws:iam::{IAM_ID}:user/{BUCKET_NAME}"
},
"Action": "s3:*",
"Resource": [
"arn:aws:s3:::ossm",
"arn:aws:s3:::ossm/*"
]
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment