SOA-C02 Question 267
Select 3You are tasked with hosting a static website on Amazon S3. You have created an S3 bucket named 'example-bucket', uploaded the necessary HTML and CSS files, and enabled static website hosting. However, when you visit the website endpoint, you see an 'Access Denied' error. What additional steps must you take to resolve this issue?
- A
Modify the bucket policy to allow public read access for all objects in the bucket.
- B
Enable versioning on the S3 bucket to manage object versions.
- C
Set the index document and error document in the static website hosting configuration.
- D
Attach an AWS Lambda function to automatically update the bucket policy.
- E
Ensure that the files in the bucket have public read access permissions.
Show answer and explanation
Correct answers: A, C, E
Explanation
To resolve the 'Access Denied' error for an S3 static website, you must ensure that the bucket policy allows public read access, configure the static website hosting settings with the index and error documents, and verify that the files in the bucket have public read permissions. These steps are essential for enabling public access to the website's resources.
- A. Correct.
Correct. To make the objects publicly accessible for a static website, you need a bucket policy that allows public read access.
- B. Incorrect.
Incorrect. Enabling versioning is unrelated to resolving the 'Access Denied' error for static website hosting.
- C. Correct.
Correct. You must specify an index document and error document in the static website hosting configuration to properly serve your website.
- D. Incorrect.
Incorrect. AWS Lambda is not required for this scenario, as bucket policies and permissions can be managed directly in the S3 console or via the AWS CLI.
- E. Correct.
Correct. Each object in the bucket must have public read permissions to be accessible for a static website.