Skip to content

Instantly share code, notes, and snippets.

@sumardi
Created June 1, 2013 09:00
Show Gist options
  • Save sumardi/5689747 to your computer and use it in GitHub Desktop.
Save sumardi/5689747 to your computer and use it in GitHub Desktop.
AWS S3 Sample Policy
{
"Version": "2008-10-17",
"Id": "my-id",
"Statement": [
{
"Sid": "Allow get requests to specific referrers",
"Effect": "Allow",
"Principal": {
"AWS": "*"
},
"Action": "s3:GetObject",
"Resource": "arn:aws:s3:::bucketname/*",
"Condition": {
"StringLike": {
"aws:Referer": "http://sitename.com/"
}
}
},
{
"Sid": "Allow CloudFront get requests",
"Effect": "Allow",
"Principal": {
"AWS": "arn:aws:iam::amazonaccountid:root"
},
"Action": "s3:GetObject",
"Resource": "arn:aws:s3:::bucketname/*"
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment