I am new to AWS and created an s3 bucket for static site hosting. I want to allow Read-Only access to everyone so they can access the website. What combination of settings gives me this scenario? Do I need to uncheck all 4 settings in the Block Public Access settings? Do I even need to add a bucket policy if all 4 settings are set to off? I just want to make sure the bucket is never written to but the account holder. Thanks.
S3 Block Public Access provides controls across an entire AWS Account or at the individual S3 bucket level to ensure that objects never have public access, now and in the future. Public access is granted to buckets and objects through access control lists (ACLs), bucket policies, or both.
06 To enable the S3 Block Public Access feature, select the Block all public access checkbox to activate all feature settings (options), and choose Save changes. 07 In the Edit Block public access (bucket settings) dialog box, type confirm in the appropriate box, then choose Confirm to apply the configuration changes.
You can enable block public access settings only for access points, buckets, and AWS accounts.
Block Public Access acts as an additional layer of protection to prevent Amazon S3 buckets from being made public accidentally.
By default, all content in Amazon S3 is private. You can then make content accessible in several different ways:
GetObject
), list contents, upload, delete, etc. The policies can also get quite specific, such as allowing access only to specific IP addresses.So, in your question, you say you would like to "allow Read-Only access to everyone so they can access the website". This would normally be done by creating a Bucket Policy such as:
{
"Version":"2012-10-17",
"Statement":[
{
"Sid":"MakeItPublic",
"Effect":"Allow",
"Principal": "*",
"Action":["s3:GetObject"],
"Resource":["arn:aws:s3:::my-bucket/*"]
}
]
}
You should first deactivate the two Block Public Access settings that refer to Bucket Policies (the bottom two).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With