SOA-C02 Question 268
Select 3Your company has created a static website consisting of HTML, CSS, and JavaScript files. They want to host this website on Amazon S3. After configuring static website hosting on the S3 bucket, users are still unable to access the website and are encountering a '403 Forbidden' error. What steps should you take to resolve this issue?
- A
Ensure the S3 bucket has a public bucket policy allowing public read access to objects.
- B
Enable versioning on the S3 bucket to ensure file availability.
- C
Set the correct permissions for the objects in the S3 bucket to allow public read access.
- D
Add an index document and an error document in the static website hosting configuration.
- E
Enable logging for the S3 bucket to troubleshoot the issue.
Show answer and explanation
Correct answers: A, C, D
Explanation
To resolve the '403 Forbidden' error when hosting a static website on Amazon S3, the bucket must allow public read access through a bucket policy, and the objects within the bucket must have the appropriate permissions. Additionally, the static website hosting configuration must specify an index document (and optionally an error document) for proper functionality. Other options, such as enabling versioning or logging, do not directly address the issue.
- A. Correct.
This is correct. For a static website hosted on S3, the bucket policy must explicitly allow public read access to objects. Otherwise, users will encounter access errors.
- B. Incorrect.
This is incorrect. Versioning is not required for static website hosting and does not address the '403 Forbidden' error.
- C. Correct.
This is correct. The objects in the bucket must have public read permissions for users to access the website content.
- D. Correct.
This is correct. Without specifying an index document and optionally an error document, the S3 static website hosting configuration will not function properly.
- E. Incorrect.
This is incorrect. While enabling logging can help troubleshoot issues, it does not resolve the '403 Forbidden' error directly.