Lab 10 · Route 53 & CloudFront¶
Performance · Est. time: 30–35 min · Cost: CloudFront + S3 for a small static site is within/near Free Tier. ⚠️ A Route 53 hosted zone is ~\$0.50/month and registering a domain costs money — the Route 53 part is optional/read unless you already own a domain.
Goal. Put CloudFront in front of an S3 static site to cache content at the edge, and understand Route 53 routing policies and CloudFront vs Global Accelerator (Topic 10).
Part A — S3 static content + CloudFront¶
- S3 → Create bucket
lab-cdn-<random>. Upload anindex.htmlwith any content. - CloudFront → Create distribution. Origin = your S3 bucket.
- Use Origin Access Control (OAC) so the bucket stays private and only CloudFront can read it
(CloudFront gives you a bucket policy to paste). Default root object:
index.html. - Create, wait for Deployed, then open the distribution domain name
(
d123.cloudfront.net) — your content is now served from edge locations.
Point: CloudFront caches the content near users, cutting latency and offloading the origin. Edit the object and note caching/TTL behavior (use an invalidation to force a refresh).
Part B — Route 53 routing policies (concept + optional)¶
If you own a domain in a Route 53 hosted zone, create records to feel the policies. Otherwise, just internalize the map:
| Policy | Use |
|---|---|
| Simple | One record |
| Weighted | Split by % (canary) |
| Latency-based | Fastest Region |
| Failover | Active-passive (with health checks) |
| Geolocation | By user location (compliance) |
| Multivalue | Up to 8 healthy records |
- Route 53 → Hosted zones → your zone → Create record.
- Choose Alias → target your CloudFront distribution (Alias is free and works at the zone apex, which a CNAME can't).
- Experiment with Weighted or Latency routing across two records.
Point: an Alias record points a root domain at AWS resources (ELB/CloudFront/S3); Latency-based ≠ Geolocation (fastest vs by-location).
Part C — CloudFront vs Global Accelerator (know the difference)¶
- CloudFront — caches HTTP/S content at the edge (what you built).
- Global Accelerator — routes TCP/UDP traffic over the AWS backbone to the nearest healthy endpoint with static anycast IPs and instant failover; no caching. Use it for gaming/VoIP/ IoT or when you need static IPs.
Teardown¶
- Disable then delete the CloudFront distribution (disabling takes a few minutes).
- Empty and delete the S3 bucket.
- Delete any Route 53 records you created (and the hosted zone if you made one just for this — it bills monthly).
✅ What you should understand now¶
- CloudFront caches static/dynamic content at edge locations to cut latency and offload the origin; use OAC to keep the S3 origin private.
- Route 53 policies: Latency (fastest), Geolocation (by location), Weighted (canary), Failover (active-passive), Multivalue (health-checked spread).
- An Alias record (not CNAME) points the zone apex at ELB/CloudFront/S3, for free.
- CloudFront caches content; Global Accelerator routes TCP/UDP traffic (static IPs, no cache).
- A Route 53 hosted zone bills monthly — delete it if you created one just to test.
Related: Learn — Networking Performance