A hands-on lab in seventeen slides, in the console and the CLI: rebuild session 6's load balancer and Auto Scaling group; make a hosted zone for our own domain and point www at the load balancer with an alias record; issue an ACM certificate with DNS validation and add an HTTPS listener; serve the bucket's static files through CloudFront with origin access control, as static.example.com; add a health check and failover records to a maintenance page in an S3 website bucket, stop the web servers and watch the failover; then clean up.
The slides
The tool is a hands-on lab in seventeen slides, one step each, with the steps to follow beside a terminal and a picture
of the lab's resources: Route 53's zone and health check, the load balancer and the buckets in us-east-1, and the
certificate and distribution at the edge.
- Introduction: what the lab makes.
- 1. Rebuild the web tier
- Rebuild the VPC and the security groups: the VPC wizard, then the groups from the CLI.
- Rebuild the load balancer and the Auto Scaling group: six commands.
- 2. The domain
- Create the hosted zone: for our own domain, or for a subdomain the instructor delegates.
- Point www at the load balancer: an alias record.
- 3. HTTPS
- Request a certificate with DNS validation:
www and static in one certificate. - Add an HTTPS listener: the padlock on
https://www.example.com.
- 4. Static files through CloudFront
- Upload the static files: the bucket stays private.
- Create the CloudFront distribution: with origin access control.
- Allow CloudFront in the bucket policy: a miss, then a hit.
- Serve the files as static.example.com: an alternate domain name and an alias record.
- 5. Failover to a maintenance page
- Create the maintenance page: a website bucket named
www.example.com. - Create the health check and create the failover records.
- Stop the web servers and watch the failover: the page, a 503, the maintenance page.
- Start the web servers again.
- 6. Clean up
The buttons on the left and right edges move between slides. So do the arrow keys and a swipe.
The lab starts where session 6's lab ends, with everything deleted, and rebuilds what it needs. The slides
Route 53, CloudFront and Global Accelerator explain what it uses.
The domain
The lab needs a domain whose DNS we control, and example.com stands for it on every slide:
- A domain of our own, registered with Route 53 or with another registrar.
- A subdomain from the instructor, such as
jane.example.org: we create its hosted zone, and the instructor adds an
NS record for it in the parent zone.
The placeholders
The IDs, ARNs and addresses are AWS's documentation placeholders: the hosted zone Z1D633PJN98FT9, the distribution
EDFDVBD6EXAMPLE at d111111abcdef8.cloudfront.net, the account 111122223333, and addresses from the documentation
ranges. The outputs are written from the CLI's service model and AWS's guides; the lab has not yet been run in a real
account.
Sources