This is effectively a condensed version of Amazon’s documentation for how to give specific IAM users and groups access to specific buckets. Your first step is to create an s3 bucket, 1 IAM group, and at least 2 IAM users:
- Here’s how to create an s3 bucket.
- Here’s how to create IAM groups.
- Here’s how to create IAM users.
Now that we have the s3 bucket, IAM group, and IAM users, we’re ready to add permissions. We only need to add permissions to the group and to the users.
Add the following json permissions to the IAM group, replacing “BUCKET_NAME” with your bucket:
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "AllowGroupToSeeBucketListAndAlsoAllowGetBucketLocationRequiredForListBucket",
"Action": [
"s3:ListAllMyBuckets",
"s3:GetBucketLocation"
],
"Effect": "Allow",
"Resource": [
"arn:aws:s3:::*"
]
},
{
"Sid": "AllowRootLevelListingOfCompanyBucket",
"Action": [
"s3:ListBucket"
],
"Effect": "Allow",
"Resource": [
"arn:aws:s3:::BUCKET_NAME"
],
"Condition": {
"StringEquals": {
"s3:prefix": [
""
],
"s3:delimiter": [
"/"
]
}
}
}
]
}
Add the following json permissions to the IAM users, replacing “BUCKET_NAME” with your bucket:
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "AllowListBucketIfSpecificPrefixIsIncludedInRequest",
"Action": [
"s3:ListBucket"
],
"Effect": "Allow",
"Resource": [
"arn:aws:s3:::BUCKET_NAME"
]
}
]
}
If you want to grant the IAM users access to a sub-bucket, then do the following, replacing “BUCKET_NAME” and “SUB_BUCKET_NAME” with the respective bucket names:
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "AllowListBucketIfSpecificPrefixIsIncludedInRequest",
"Action": [
"s3:ListBucket"
],
"Effect": "Allow",
"Resource": [
"arn:aws:s3:::BUCKET_NAME"
],
"Condition": {
"StringLike": {
"s3:prefix": [
"SUB_BUCKET/*"
]
}
}
}
]
}
That’s it!
More posts from themightymo.com
Reorganize Your WordPress 2.7 Admin Panel with Fluency 2.0
Yesterday I discovered the new Fluency 2.0 plugin for WordPress 2.7. It does a fantastic job of cleaning up the admin interface and makes the back-end WordPress experience much better for users.
We Now Offer Search Engine Optimization!
We have just teamed up with one of the web’s finest search engine optimization gurus, Greg Cryns, and will now be offering his services to you, our customers! For you, our customer, this means that we now have added expertise in driving targeted traffic to your website. Greg has over a decade worth of search…
Adobe CS4 Flash MN Presentation at FlashMN
Below are my notes from tonight’s FlashMN meeting starring Dustin Tauer. The presentation focused on the new features of Adobe Creative Suite 4. Illustrator CS4 Can create multiple art boards. So, if I wanted to use artwork for the front and back of t-shirt, I would create 2 art boards (up to 100). There are…