Amazon CloudFront (CLOUDFRONT)
Global edge reverse proxy providing TLS termination, DDoS mitigation (AWS Shield Standard), edge caching, Origin Access Control (OAC) for private S3 storage, and dynamic path-based routing.
AWS Container Placement
Regional / Global Managed Scope (Outside VPC Subnets)
Summary
Global Content Delivery Network (CDN) service that securely delivers data, videos, applications, and APIs to customers globally with low latency and high transfer speeds.
When to Use (SAA-C03)
Place in front of S3 static websites (always use OAC, never public S3!) or global ALB/API Gateway origins.
Allowed Ingress Connections & Ports
| Source Service | Protocol | Port | Architectural Rationale |
|---|---|---|---|
| WEBCLIENT | HTTP, HTTPS | 80, 443 | Global client browsers and mobile app requests |
| ROUTE53 | DNS | 53 | Edge DNS resolution pointing clients to closest Edge Location |
| WAF | INSPECT | 80, 443 | AWS WAF Layer 7 inspection at CloudFront edge |
Allowed Egress Targets & Ports
| Target Service | Protocol | Port | Data Flow Rationale |
|---|---|---|---|
| S3 | HTTPS / SigV4 | 443 | Origin requests to private S3 bucket using Origin Access Control (OAC) |
| ALB | HTTPS | 443 | Dynamic API origin requests forwarded with custom origin verification header |
| APIGW | HTTPS | 443 | Regional API Gateway backend proxying |
Key Configuration Parameters & AWS Best Practices
| Parameter | Format / Example | Purpose & Rationale |
|---|---|---|
| Default Root Object (cloudFrontDefaultRootObject) (Required) | index.html | The object that CloudFront requests from your origin when an end user requests the root URL (https://example.com/). Why: Required for single-page applications and web sites to avoid returning a 403 or 404 on the root path. |
| Viewer Protocol Policy (cloudFrontViewerProtocolPolicy) (Required) | redirect-to-https | Specifies the protocol that users can use to access the files in origin. Why: Enforces encryption in transit and complies with security benchmarks by redirecting insecure HTTP requests to HTTPS. |
| Price Class (cloudFrontPriceClass) (Required) | PriceClass_100 | The geographic tier of CloudFront edge locations utilized by the distribution. Why: Controls operational bandwidth costs by restricting edge caching to lower-cost regions (e.g. US/Europe for PriceClass_100). |
| Origin Access Control (cloudFrontOriginAccessControl) | true | Authenticates CloudFront origin requests to private S3 buckets using AWS Signature Version 4 (SigV4). Why: Replaces legacy Origin Access Identities (OAI) and supports all S3 buckets in all regions, SSE-KMS encryption, and dynamic PUT/POST. |
| Alternate Domain Names (cloudFrontAliases) | cdn.example.com, assets.example.com | Custom domain names (CNAMEs) used to route traffic to the distribution. Why: Enables serving traffic from custom branding domains (e.g. cdn.company.com) rather than d123.cloudfront.net. |
| ACM Certificate ARN (cloudFrontCertificateArn) | arn:aws:acm:us-east-1:xxxx:certificate/xxxx | SSL/TLS certificate from AWS Certificate Manager used for custom domain aliases. Why: CloudFront requires custom certificates to be provisioned strictly in the us-east-1 (N. Virginia) region. |
| Web ACL ID (cloudFrontWebAclNodeId) | AWS WAF Web ACL ARN (CLOUDFRONT scope) | Attaches Layer 7 Web Application Firewall to edge distribution. Why: Mitigates DDoS attacks, SQL injection, and automated scraping at edge PoPs before traffic reaches origins. |
Practice Labs Using Amazon CloudFront
Global Video Streaming: CloudFront OAC Origin Shielding & S3 Leak
Enable Origin Access Control (OAC) on CloudFront and enable Block Public Access on the origin S3 bucket.…
BUILD-13Build: Multi-Region CloudFront Edge + WAF + S3 OAC
Design from scratch: Route 53 DNS -> AWS WAF -> CloudFront CDN -> Private S3 Bucket.…
Frequently Asked Questions
Where does Amazon CloudFront live inside an AWS VPC architecture?
Valid container placement: Regional / Global Managed Scope (Outside VPC Subnets). Global edge reverse proxy providing TLS termination, DDoS mitigation (AWS Shield Standard), edge caching, Origin Access Control (OAC) for private S3 storage, and dynamic path-based routing.
When should I use Amazon CloudFront on the AWS SAA-C03 exam?
Place in front of S3 static websites (always use OAC, never public S3!) or global ALB/API Gateway origins.
Can I simulate Amazon CloudFront packet routing without an AWS account?
Yes. CloudTracer simulates Amazon CloudFront along with 53 AWS services directly in your browser and exports production Terraform HCL.