Articles → AWS → Create A Policy For The AWS S3 Bucket

Create A Policy For The AWS S3 Bucket






Scenario





Creation Of Bucket




  1. Uncheck the Block all public access checkbox
  2. Check the checkbox I acknowledge that the current settings might result in this bucket and the objects within becoming public.
Picture showing unchecking the checkbox Block all public access to make bucket public
Click to Enlarge


Create The Policy JSON Using The AWS Policy Generator Tool




FieldValue
EffectAllow
Select Type of PolicyS3 Bucket Policy
Principal*
ActionsGetObject


Picture showing selecting the action as GetObject
Click to Enlarge



FieldValue
Amazon Resource Name (ARN)arn:aws:s3::[bucket Name]/*




Picture showing adding the policy statement using the Add Statement button
Click to Enlarge



Picture showing the policy json created on click of the Generate Policy button
Click to Enlarge


Add The Policy JSON In S3 Bucket




Picture showing the Edit button for editing the bucket policy
Click to Enlarge



Picture showing the confirmation message for the creation of bucket policy
Click to Enlarge




IAM Policy Vs Bucket Policy


ScenarioPolicy Type
You have numerous S3 buckets and each bucket has different permissions requirementIAM policy
You want to keep access control policies in the S3 environmentBucket policy
Your IAM policy has reached its service limitsBucket policy



Posted By  -  Karan Gupta
 
Posted On  -  Saturday, September 25, 2021
 
Updated On  -  Friday, August 5, 2022

Query/Feedback


Your Email Id
 
Subject
 
Query/FeedbackCharacters remaining 250