SOA-C02 Question 266
Select 3You have been tasked with hosting a static website on Amazon S3. You have created a bucket named 'example-bucket' and uploaded your website files. However, when you access the bucket's endpoint, you receive an 'Access Denied' error. Which steps must you take to properly configure the S3 bucket for static website hosting?
- A
Enable static website hosting in the S3 bucket properties and specify an index document.
- B
Attach a bucket policy to grant public read access to the objects in the bucket.
- C
Configure an AWS Lambda function to serve the static content directly from Amazon S3.
- D
Ensure the index document file (e.g., index.html) exists in the root of the bucket.
- E
Enable S3 Transfer Acceleration for the bucket to allow public access.
Show answer and explanation
Correct answers: A, B, D
Explanation
To host a static website on Amazon S3, you must enable static website hosting in the bucket's properties and specify an index document. Additionally, a bucket policy is needed to allow public read access to the website's content. The index document must exist in the bucket to serve as the default resource. AWS Lambda and S3 Transfer Acceleration are not required for this use case.
- A. Correct.
Correct. Enabling static website hosting and specifying an index document is required to properly serve the static content from S3.
- B. Correct.
Correct. A bucket policy granting public read access is necessary to ensure users can access the website content without authentication.
- C. Incorrect.
Incorrect. AWS Lambda is not required or relevant for hosting static websites on S3. Static website hosting is managed directly through S3 configurations.
- D. Correct.
Correct. The index document (e.g., index.html) must exist in the bucket as it serves as the default resource when a user accesses the root URL.
- E. Incorrect.
Incorrect. S3 Transfer Acceleration is used for faster data transfers, not for enabling public access or static website hosting.