Setting bucket Permissions in S3 – Hands On

Lets see how to set permissions on our S3 bucket and then we will see the affects of the policy on our S3 bucket.

Upload a few files in S3 bucket.

Go to the bucket homepage and click on permissions.

In the permissions got to the bucket policy sec…


This content originally appeared on DEV Community and was authored by Ajit Singh

Lets see how to set permissions on our S3 bucket and then we will see the affects of the policy on our S3 bucket.

  • Upload a few files in S3 bucket. S3 permissions
  • Go to the bucket homepage and click on permissions. S3 permissions
  • In the permissions got to the bucket policy section and click edit. S3 permissions
  • This takes us to a section where we edit our policies. S3 permissions
  • This is our first time generating our policy. So, lets use the policy generator given by Amazon to make our policy. To use AWS policy generator click policy generator button. S3 permissions
  • AWS policy generator generates policy many different things so select bucket policy from the type of policy.

  • In this policy we will make our bucket objects public. So that anyone can see them via the url. To do that we set the following on policy generator.

    • Effect: Allow - This means who ever falls in this policy will be allowed to do the action defined in the bucket policy.
    • Principal: * - This means we ale allowing everyone to action defined in the policy
    • Actions: GetObject - This will allow us to set policy for getting the objects from S3 bucket.
    • Amazon Resource Name (ARN): Bucket ARN get that from the page where we clicked policy generator and add /* S3 permissions S3 permissions
  • Click add statement and after that click on generate policy. A policy is generated.

    S3 permissions

  • Copy this policy and paste it in the edit policy section and click on save changes this will not allow you to save the changes still.

    S3 permissions

  • This is because there is a block all public access section in our permissions tab. Edit that and allow all public access by unchecking block all public access.

    S3 permissionsS3 permissions

  • Now you can save you policy.

    S3 permissions

  • We have changed the bucket policy. Now click on an object in the bucket and click on the URL given it should open it.

    S3 permissions

So we have changed the S3 bucket policy. We will set other policies and how they affect our bucket later on. Next we will study how to host static sites on S3.


This content originally appeared on DEV Community and was authored by Ajit Singh


Print Share Comment Cite Upload Translate Updates
APA

Ajit Singh | Sciencx (2021-07-19T05:55:07+00:00) Setting bucket Permissions in S3 – Hands On. Retrieved from https://www.scien.cx/2021/07/19/setting-bucket-permissions-in-s3-hands-on/

MLA
" » Setting bucket Permissions in S3 – Hands On." Ajit Singh | Sciencx - Monday July 19, 2021, https://www.scien.cx/2021/07/19/setting-bucket-permissions-in-s3-hands-on/
HARVARD
Ajit Singh | Sciencx Monday July 19, 2021 » Setting bucket Permissions in S3 – Hands On., viewed ,<https://www.scien.cx/2021/07/19/setting-bucket-permissions-in-s3-hands-on/>
VANCOUVER
Ajit Singh | Sciencx - » Setting bucket Permissions in S3 – Hands On. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2021/07/19/setting-bucket-permissions-in-s3-hands-on/
CHICAGO
" » Setting bucket Permissions in S3 – Hands On." Ajit Singh | Sciencx - Accessed . https://www.scien.cx/2021/07/19/setting-bucket-permissions-in-s3-hands-on/
IEEE
" » Setting bucket Permissions in S3 – Hands On." Ajit Singh | Sciencx [Online]. Available: https://www.scien.cx/2021/07/19/setting-bucket-permissions-in-s3-hands-on/. [Accessed: ]
rf:citation
» Setting bucket Permissions in S3 – Hands On | Ajit Singh | Sciencx | https://www.scien.cx/2021/07/19/setting-bucket-permissions-in-s3-hands-on/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.