This shows how to use S3 Bucket Policy to make all files public.
Sample JSON Bucket Policy
The S3 Bucket’s name is karlsan. Therefore, we refer to this resource and all the files within it as arn:aws:s3:::karlsan/*
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | { "Version": "2012-10-17", "Statement": [ { "Sid": "PublicReadGetObject", "Effect": "Allow", "Principal": "*", "Action": [ "s3:GetObject" ], "Resource": [ "arn:aws:s3:::karlsan/*" ] } ] } |
Edit S3 Public Access Setting
Before anything else, we need to modify the Bucket’s Public Access Settings.
All items should be unchecked. Click Save.
Type “confirm” and click Confirm.
Update S3 Bucket Policy
Go to the S3 Bucket’s Permissions tab.
Then, click Bucket Policy.
Copy and paste the JSON value above. Then, click Save.
Now all files within the Bucket are publicly available.