This section covers the following objective of Domain 5 (Networking and Content Delivery) from the official AWS Certified SysOps Administrator – Associate (SOA-C02) exam guide:
5.2 Configure domains, DNS services, and content delivery
If you can correctly answer these questions before going through this section, save time by skimming the Exam Alerts in this section and then completing the Cram Quiz at the end of the section.
1. Should you use Route 53 when configuring a static website in S3?
2. Which security configurations must be made prior to using S3 to host a static website?
1. Answer: Route 53 can be used if you wish to use DNS to direct requests for your website to an S3 bucket endpoint.
2. Answer: You must configure the bucket permissions to allow public access and the bucket policy to allow public read access.
You can place static assets such as HTML files, scripts, and images in an S3 bucket. Doing so enables you to host a website with no web servers. After creating an S3 bucket, you can enable static website hosting on it under the properties screen, as seen in Figure 12.8. You must also allow public access to the bucket, as shown in Figure 12.9.
FIGURE 12.8 Enabling static website hosting
FIGURE 12.9 S3 public access
When the bucket is publicly available, the bucket policy must be updated to grant public read access, as shown in Figure 12.10.
FIGURE 12.10 Bucket policy
You must now create or upload a landing page for the static website (typically called index.html). You can also upload an error page. When static website hosting was enabled, a bucket website endpoint was created, as shown in Figure 12.11. You can configure an alias record in Route 53 to point traffic for your website to this S3 bucket website endpoint.
FIGURE 12.11 Bucket website endpoint
An S3 static website does not require any servers and is a managed service. It can be used as a low-cost static backup for a primary website in the event of an outage by configuring failover routing in Route 53.
Answer these questions. The answers follow the last question. If you cannot answer these questions correctly, consider reading this section again until you can.
1. Which configurations must be completed to allow S3 static website hosting? (Choose three.)
A. Enable static website hosting on the bucket.
B. Manually create a bucket website endpoint.
C. Configure the bucket policy to allow public read access.
D. Configure the IAM policy to allow public read access.
E. Configure the bucket permissions to allow public access.
2. You must configure a Route 53 domain name (example.com) to route traffic to a static website hosted on EC2. If the EC2 instance is down, Route 53 should redirect requests to a static website in Amazon S3. Which configurations are required? (Choose two.)
A. Configure weighted routing in Route 53 with a health check being performed against the EC2 IP address and the S3 bucket.
B. Create an alias record for the S3 bucket as the secondary.
C. Create a CNAME record for the S3 bucket as the secondary.
D. Configure failover routing in Route 53 with a health check being performed against the EC2 IP address.
1. Answer: A, C, and E are correct. To enable website hosting on S3, you must configure the bucket permissions to allow public access, enable static website hosting on the bucket, and configure the bucket policy to allow public read access.
2. Answer: B and D are correct. When a Route 53 health check against the EC2 instance returns unhealthy, the static website in S3 is what users see. When your health check returns healthy again, traffic is automatically routed back to the EC2 instance. There is no need for a health check on the S3 static website. An alias record must be used for the zone apex.