Skip to content

Instantly share code, notes, and snippets.

@joshuaquek
Created February 22, 2020 12:03
Show Gist options
  • Save joshuaquek/94316cb443862f9aebdaeb3954a877c0 to your computer and use it in GitHub Desktop.
Save joshuaquek/94316cb443862f9aebdaeb3954a877c0 to your computer and use it in GitHub Desktop.
.S3-bucket-programmatic-access
Summary: IAM Policy that allows S3 programmatic access to only one bucket, while still being able to view the list of all available buckets (but not all those buckets' contents)
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "Stmt1480515305000",
"Effect": "Allow",
"Action": [
"s3:ListAllMyBuckets",
"s3:GetBucketLocation"
],
"Resource": [
"arn:aws:s3:::*"
]
},
{
"Sid": "Stmt1480515305002",
"Effect": "Allow",
"Action": [
"s3:List*",
"s3:GetObject",
"s3:PutObject",
"s3:DeleteObject"
],
"Resource": [
"arn:aws:s3:::my-secret-bucket-arn-name",
"arn:aws:s3:::my-secret-bucket-arn-name/*"
]
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment