AWS

AWS S3 bucket policy to grant the public access to all objects.

Learn how to grant public access to all the objects of your S3 bucket.

· 2 min read
AWS S3 bucket policy to grant the public access to all objects.

Hello everyone, In this article, I'll be discussing how you can grant public access to all your objects in the AWS S3 bucket.

STEP 1

Firstly open your AWS S3 bucket and open the 'Permissions' tab.

Now scroll down to 'Bucket public access' settings.

If all the public access is blocked just like the above image click on the edit button. This will open the page to edit public access settings.

Now uncheck the 'Block all public access' open and click on save changes. It will open a popup to confirm the action. Confirm it.

STEP 2

Now move back to the 'Permissions' tab again.

And scroll down to the 'Bucket policy' section and click on the edit button.

This will open the 'Edit bucket policy' page will be looking something like this.

STEP 3

Now paste the policy written below to the editor. The policy grants read access to all the objects present in the current bucket.

{
	"Version": "2012-10-17",
	"Statement": [
		{
			"Action": [
				"s3:GetObject"
			],
			"Effect": "Allow",
			"Principal": {
				"AWS": [
					"*"
				]
			},
			"Resource": [
				"arn:aws:s3:::BUCKET_NAME/*"
			]
		}
	]
}

Replace the BUCKET_NAME with the name of your bucket.

Now click on the 'Save changes' button to apply the policy.

Once you saved the changes, all the objects will be accessed publicly. To confirm that you can also check a badge name 'Publicly accessible' below the bucket name.

So this is how you can grant public access to all your objects in the S3 bucket.

I hope, this article helped you. If you have any questions related to this article you can ask me in the comment section.

If you liked the article, then please don't forget to subscribe for more such articles.

Related Articles

AWS EC2 Elastic IP Tutorial
· 4 min read
How to set up MySQL server on AWS RDS
· 4 min read
Amazon S3 Storage Classes Basics
· 4 min read
How to create a bucket in AWS S3
· 3 min read