S3 origin
Origin Access Control
Lets only CloudFront read your S3 bucket without making it public. It supports SSE-KMS encrypted objects and PUT and DELETE requests, and is the recommended replacement for legacy OAI.
Amazon CloudFront · Content delivery network
CloudFront receives user requests at the edge location with the lowest latency and serves them from cache. Only requests that miss the cache travel over the AWS network to the origin, which can sit in a private subnet or a private S3 bucket.
The object missing at the POP is fetched from the regional edge cache and also stored at the POP. The request never reached the origin.
Monthly availability SLA
Maximum cacheable size per GET response
QUIC over TLS 1.3, with connection migration
Shield Standard DDoS protection by default
Why CloudFront
To deliver content and APIs with the same quality to users at home and abroad, finish requests close to users and reduce the number of requests that reach the origin.
POPs, regional edge caches, and Origin Shield absorb requests in turn, reducing load on the origin.
Shield Standard blocks network- and transport-layer DDoS, and AWS WAF filters application-layer requests.
CloudFront Functions and Lambda@Edge handle headers, URLs, and authentication logic in front of the origin.
Request path
DNS routes users to the POP with the lowest latency, and a cache miss moves on to the next tier. Proxy methods such as PUT, POST, PATCH, OPTIONS, and DELETE, and dynamic requests, bypass the regional edge cache and go directly from the POP to the origin.
Terminates TLS and checks the cache. AWS WAF inspection and CloudFront Functions run at this stage.
TLS terminationViewer mTLSAWS WAFCloudFront FunctionsA larger cache shared by the POPs in a geographic area. If the origin is an S3 bucket in the same Region, requests skip this tier and go directly to S3.
Shared cacheCache missGET · HEADWith Origin Shield enabled, origin requests from all cache tiers converge on one designated Region, so requests for the same object can be collapsed into a single request to the origin.
Origin ShieldOrigin groupOACVPC originOrigin mTLSOrigin request / responseFeatures
S3 origin
Lets only CloudFront read your S3 bucket without making it public. It supports SSE-KMS encrypted objects and PUT and DELETE requests, and is the recommended replacement for legacy OAI.
Private origin
Use ALBs, NLBs, and EC2 instances in private subnets as origins. CloudFront reaches them through service-managed ENIs, so origins need no public IP. The VPC must have an internet gateway attached, and you can use VPC origins shared from other accounts through AWS RAM.
Availability
Group a primary and a secondary origin into an origin group. On specified status codes, connection failures, or timeouts, CloudFront retries GET, HEAD, and OPTIONS requests on the secondary.
Edge security
Associate a web ACL with a distribution to inspect L7 requests. Shield Standard applies to every distribution at no extra charge, and you can upgrade to Shield Advanced.
Client identity
Validates client X.509 certificates against a trust store at the edge, blocking untrusted clients before they reach your application. You can add validation logic with a Connection Function, check OCSP revocation, and use passthrough mode to forward certificates to the origin. There is no additional charge.
Pricing
Bundles CDN, AWS WAF and DDoS protection, bot management, Route 53 DNS, CloudWatch Logs ingestion, edge compute, and S3 storage credits into a flat monthly price per distribution. There are four tiers (Free, Pro, Business, and Premium) with no overage charges.
Edge compute
Put lightweight, short-running logic such as header manipulation, URL rewrites, and token validation in CloudFront Functions, and logic that needs network calls or access to the request body in Lambda@Edge.
| Item | CloudFront Functions | Lambda@Edge |
|---|---|---|
| Runtime | JavaScript | Node.js, Python |
| Trigger events | Viewer request, Viewer response (Connection Function for the mTLS connection stage) | Viewer request·response, Origin request·response |
| Execution time | Less than 1 ms | Up to 30 seconds for both viewer and origin events |
| Maximum memory | 2 MB | Same as Lambda quotas, up to 10,240 MB |
| Code size | 10 KB | 50 MB for both viewer and origin |
| Network · body access | No | Yes |
| Scale | Millions of requests per second | Up to 10,000 requests per second per Region |
Reference architecture
Dynamic requests go through a VPC origin to an ALB in a private subnet, and static files go to S3 protected by OAC. An origin group with the ALB as primary and an S3 static page as secondary keeps responses flowing during failures.
On narrow screens, swipe the diagram sideways.
Getting started
Set up an S3 bucket or an ALB in a private subnet. Neither needs to be public.
Register the origins, then attach OAC to S3 and a VPC origin to the ALB.
For each path pattern, set the cache policy, origin request policy, and allowed methods.
Add alternate domain names and attach an ACM certificate from us-east-1.
Create a Route 53 alias record that points to the distribution, and verify caching behavior with response headers.
Pricing
With pay-as-you-go pricing, data transfer out to the internet and request counts make up most of the cost. Alternatively, you can choose a flat-rate plan that bundles CDN, AWS WAF, DDoS protection, Route 53 DNS, and more into a monthly price.
| Component | Billed by | Notes |
|---|---|---|
| Data transfer to internet | Per GB sent from the edge to users, with rates varying by geographic region | The free tier includes 1 TB per month. |
| Data transfer to origin | Per GB of POST and PUT request bodies and WebSocket and gRPC client-to-server traffic | Transfer from AWS origins such as S3 and VPC origins to CloudFront is free. |
| HTTP · HTTPS requests | Per 10,000 requests, with separate HTTP and HTTPS rates | The free tier includes 10 million requests per month. |
| Origin Shield | Per 10,000 requests passing through Origin Shield, based on the designated Region | Charged only for requests that reach Origin Shield on a cache miss. |
| Invalidation | Per requested path or tag | The first 1,000 paths or tags each month are free. |
| Edge functions | Per 1 million CloudFront Functions invocations and per 1 million KeyValueStore reads. Lambda@Edge per 1 million requests plus execution duration in GB-seconds | The Functions free tier includes 2 million invocations and 2 million KeyValueStore reads per month; Lambda@Edge has no free tier. |
| Additional features | Real-time logs per 1 million lines, field-level encryption per 10,000 requests, dedicated IP custom SSL per certificate per month, Anycast static IPs per IPv4 address per hour | IPv6 addresses in Anycast static IP lists are free. |
| Related services | AWS WAF web ACLs, rules, and requests; Shield Advanced; Route 53 | Billed separately by each service. Shield Standard is free. |
Rates vary by region and usage. See the CloudFront pricing page for current rates.
Next step
Bring your content types, user distribution, origin locations, and security requirements, and we will review cache policies and origin protection together.