Skip to content

Instantly share code, notes, and snippets.

@codeprimate
Last active January 30, 2017 19:28
Show Gist options
  • Select an option

  • Save codeprimate/f91e83adaec6ff7e3cbc to your computer and use it in GitHub Desktop.

Select an option

Save codeprimate/f91e83adaec6ff7e3cbc to your computer and use it in GitHub Desktop.
AWS IAM Policy for S3 Access
# Public read bucket policy: Edit the bucket policy directly and input this (replace BUCKET)
{
"Version":"2012-10-17",
"Statement":[{
"Sid":"AllowPublicRead",
"Effect":"Allow",
"Principal": {
"AWS": "*"
},
"Action":["s3:GetObject"],
"Resource":["arn:aws:s3:::BUCKET/*"
]
}
]
}
# User policy: Create and name this policy, then assign it to user accounts (replace BUCKET)
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"s3:ListBucket",
"s3:GetBucketLocation",
"s3:ListBucketMultipartUploads"
],
"Resource": "arn:aws:s3:::BUCKET",
"Condition": {}
},
{
"Effect": "Allow",
"Action": [
"s3:AbortMultipartUpload",
"s3:DeleteObject",
"s3:DeleteObjectVersion",
"s3:GetObject",
"s3:GetObjectAcl",
"s3:GetObjectVersion",
"s3:GetObjectVersionAcl",
"s3:PutObject",
"s3:PutObjectAcl",
"s3:PutObjectAclVersion"
],
"Resource": "arn:aws:s3:::BUCKET/*",
"Condition": {}
},
{
"Effect": "Allow",
"Action": "s3:ListAllMyBuckets",
"Resource": "*",
"Condition": {}
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment