Published May 27, 2018 by

Grant Access To Only One S3 Bucket to AWS IAM User

This tutorial gives an overview of how to restrict an AWS IAM user’s access to a single S3 bucket.

Create a policy for AWS bucket

Go to IAM >> Policies >> Create Policy >>  JSON >>



Inset below policy here.

 {  
   "Version": "2012-10-17",  
   "Statement": [  
     {  
       "Effect": "Allow",  
       "Action": [  
             "s3:GetBucketLocation",  
             "s3:ListAllMyBuckets"  
            ],  
       "Resource": "arn:aws:s3:::*"  
     },  
     {  
       "Effect": "Allow",  
       "Action": "s3:*",  
       "Resource": [  
         "arn:aws:s3:::YOUR-BUCKET",  
         "arn:aws:s3:::YOUR-BUCKET/*"  
       ]  
     }  
   ]  
 }  

Now click on 'Review Policy' 
  

Here it asks for policy name and description. after insert detailed click on 'Create Policy' button.

Now AWS created a new policy for only single S3-bucket access which named you to insert in policy.



Attach Policy to User and Group

Now attach this policy which user and group, you want to access only that bucket which mentioned you in policy and restricts remain bucket access.