SOA-C02 Question 265
Select 2Your company wants to host a static website using Amazon S3. You have created an S3 bucket named 'example-bucket' and uploaded the required HTML, CSS, and JavaScript files. However, when you access the bucket endpoint, you receive an error message instead of the website content. What steps should you take to ensure the static website is accessible?
- A
Enable static website hosting in the bucket properties and specify an index document.
- B
Ensure the bucket is public by attaching a bucket policy that grants read permissions.
- C
Configure an Amazon CloudFront distribution to serve the content from the S3 bucket.
- D
Add an SSL certificate to secure the S3 bucket endpoint.
- E
Set the bucket's default encryption to 'AES-256' to allow public access to the static website.
Show answer and explanation
Correct answers: A, B
Explanation
To host a static website using Amazon S3, you need to enable static website hosting in the bucket properties and specify an index document. Additionally, public access to the bucket must be granted using bucket policies or ACLs, as S3 buckets are private by default. While other options like CloudFront and encryption may improve security or performance, they are not required for basic static website hosting.
- A. Correct.
Correct. Enabling static website hosting and specifying an index document is a mandatory step to make the S3 bucket function as a static website.
- B. Correct.
Correct. To make the website accessible to the public, the bucket must have a policy that grants public read access to the objects.
- C. Incorrect.
Incorrect. While CloudFront can enhance performance and add SSL support, it is not required to host a static website on S3.
- D. Incorrect.
Incorrect. Adding an SSL certificate is not applicable for the S3 static website endpoint. SSL is only used if you configure CloudFront for the website.
- E. Incorrect.
Incorrect. Bucket encryption settings are unrelated to enabling public access or configuring static website hosting.