Wednesday 22 June 2016

Create IAM User Having Access to a Single S3 Bucket

IAM User Creation Having Access to One Bucket

User With Permission on One Bucket

This post talks about how to create a user and a policy to having access to a specific bucket. The fundamental process to be kept in mind is:
  • Create an IAM user
  • Download/Save the credentials for this user (Access Key Id and Secret Access Key)
  • Create a Policy having full access to the specific bucket
  • Attach the Policy to newly created user.
Creating the user



Download the Credentials (Access Key Id and Secret Access Key)


Create the Policy

Following is the content to be insert in the policy. Remember to put your bucket name instead of mybucket


{
 "Version": "2012-10-17",
 "Statement": [
 {
 "Effect": "Allow",
 "Action": "s3:ListAllMyBuckets",
 "Resource": "arn:aws:s3:::*"
 },
 {
 "Effect": "Allow",
 "Action": [
   "s3:ListBucket",
   "s3:GetBucketLocation" 
 ],
 "Resource": [ "arn:aws:s3:::mybucket"]
 },
 {
 "Effect": "Allow",
 "Action": [ 
   "s3:PutObject", 
   "s3:GetObject", 
   "s3:DeleteObject"
 ],
 "Resource": [ "arn:aws:s3:::mybucket/*"]
 }
 ]
}

Attach this policy to the User.
Now This user have the access to mybucket and no other bucket are accessible by this user.

0 comments:

Post a Comment

 

Copyright @ 2013 Appychip.

Designed by Appychip & YouTube Channel