AWS CloudFront — CDN for your ALB

What you’ll learn
AWS CloudFront is Amazon’s content delivery network (CDN). It can improve performance, scalability, and global reach for web apps by caching at edge locations and terminating viewer TLS closer to users.
This guide walks through integrating CloudFront with an existing Application Load Balancer (ALB) that already serves your domain via a Route 53 hosted zone.
Prerequisites
Before you begin, ensure you have the following:
- An AWS account with access to CloudFront, Route 53, and your ALB.
- An ALB already serving traffic for your domain (DNS in Route 53 pointed at the load balancer or a stable hostname you can reference as the origin).
- For custom domain names (alternate domain names / CNAMEs) on CloudFront with ACM, public certificates must be requested in the US East (N. Virginia) us-east-1 Region, per AWS requirements for CloudFront.
Create a CloudFront distribution
Follow these steps in the AWS console.
Open the AWS Management Console and go to CloudFront.
Choose Create distribution.

AWS Management Console Under Origin, set Origin domain to your Application Load Balancer. Set the Origin protocol policy to match how viewers reach CloudFront (commonly HTTPS only or Match viewer, depending on your TLS setup).

CloudFront Set Minimum origin SSL protocol to at least TLS 1.2 (avoid deprecated protocols for origins).

CloudFront Under Default cache behavior, choose Viewer protocol policy (for example redirect HTTP to HTTPS) and Allowed HTTP methods appropriate for your app (GET/HEAD or all methods if you need APIs).

CloudFront Under Cache key and origin requests, use the console recommended settings or pick a cache policy and origin request policy that match how much of the request should affect the cache key (query strings, headers, cookies).

CloudFront Under Web Application Firewall (WAF), enable protections if you want AWS WAF in front of this distribution (optional; may add cost and requires a web ACL).

CloudFront Under Settings, choose Price class (for example all edge locations or a smaller set), add Alternate domain name (CNAME) if needed, and attach a custom SSL certificate from ACM in us-east-1 when using a custom domain on CloudFront.

CloudFront Review Supported HTTP versions and remaining defaults, then choose Create distribution.

CloudFront When deployment completes, your distribution appears as Deployed in the console.

CloudFront
Monitor and configure CloudFront
- Return to the CloudFront console and open your distribution.
- Review Monitoring metrics (requests, error rates, cache hit ratio) and enable standard logging or real-time logs if you need deeper analysis.
- Adjust cache behaviours, TTLs, compression, and origin settings as your traffic and content change.
Update DNS records in Route 53
If the apex or hostname still points at the ALB directly, point traffic at CloudFront instead. With Route 53, an alias A (and AAAA if you use IPv6) to the CloudFront distribution is the usual approach.
- Open Route 53 and select your hosted zone.
- Edit the record for your site so the alias target is your CloudFront distribution (distribution domain name), not the ALB DNS name.
Save the change and allow DNS TTL to expire for clients.

Route 53
Invalidate cache (optional)
After you deploy new assets or HTML, you may need to clear cached objects so viewers see updates immediately.
- Open the CloudFront console and select your distribution.
- Open the Invalidations tab.
Choose Create invalidation and enter paths (for example
/index.htmlor/*). Use broad paths sparingly; invalidations have service limits and cost considerations.
CloudFront
Key takeaways
CloudFront sits in front of your origin (here, an ALB) and caches responses at the edge for lower latency.
Tune cache and origin request policies, TLS to the origin, and viewer protocol policy for security and hit ratio.
Use Route 53 alias records to CloudFront; use invalidations when you must bypass cache for specific paths.
Frequently asked questions
Next: object storage
Create an S3 bucket, upload files, and understand how public read policies differ from private origins fronted by CloudFront.
CloudFront serves content from edge locations worldwide. Cached responses are returned close to viewers; cache misses and dynamic requests are pulled from your origin (here, an ALB) with latency that depends on origin geography and tuning.
8 people found this page helpful
