Created
November 22, 2016 18:21
-
-
Save patrickbrandt/804ed52117443e4b1428db5e97f1721c to your computer and use it in GitHub Desktop.
IAM Policy for read-only S3 bucket access
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"Version": "2012-10-17", | |
"Statement": [ | |
{ | |
"Sid": "AllowUserToSeeBucketListInTheConsole", | |
"Action": [ | |
"s3:ListAllMyBuckets", | |
"s3:GetBucketLocation" | |
], | |
"Effect": "Allow", | |
"Resource": [ | |
"arn:aws:s3:::*" | |
] | |
}, | |
{ | |
"Sid": "AllowRootAndHomeListingOfCompanyBucket", | |
"Action": [ | |
"s3:ListBucket" | |
], | |
"Effect": "Allow", | |
"Resource": [ | |
"arn:aws:s3:::images-ccnag-com" | |
], | |
"Condition": { | |
"StringEquals": { | |
"s3:prefix": [ | |
"", | |
"PINCODES/" | |
], | |
"s3:delimiter": [ | |
"/" | |
] | |
} | |
} | |
}, | |
{ | |
"Sid": "GetPincodesInImagesCcnagComBucket", | |
"Effect": "Allow", | |
"Action": [ | |
"s3:GetObject" | |
], | |
"Resource": [ | |
"arn:aws:s3:::images-ccnag-com/PINCODES/*" | |
] | |
} | |
] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment