The static website hosting feature was enabled on the bucket and content was uploaded; however, upon navigating to the site, the following error message is received:403 Forbidden `” Access DeniedWhat change should be made to fix this error?
Add a bucket policy that grants everyone read access to the bucket
Add a bucket policy that grants everyone read access to the bucket objects
Remove the default bucket policy that denies read access to the bucket
Configure cross-origin resource sharing (CORS) on the bucket
Explanations:
A bucket policy granting read access to the entire bucket is not sufficient. S3 requires specific permissions for the objects within the bucket, not the bucket itself.
Adding a bucket policy that grants read access to the objects within the bucket allows the static website to be publicly accessible.
Removing the default bucket policy does not address the issue, as the default policy does not necessarily block access to objects. The correct fix is to grant read access to the objects.
CORS is used to manage cross-origin resource sharing and is not relevant for resolving the “403 Forbidden” error for a static website.