# Amazon CloudFront

> Amazon CloudFront is a content delivery network (CDN) service provided by AWS.

- Source: https://www.itwonderlab.com/amazon-cloudfront/
- Published: 2024-01-11
- Updated: 2026-10-05
- Author: Javier Ruiz Jiménez (https://www.javierruizjimenez.com/)
- Site: IT Wonder Lab (https://www.itwonderlab.com/)

---

## Content Delivery Network

Amazon CloudFront is a content delivery network (CDN) service provided by AWS. It is designed to deliver content, including web pages, videos, images, and other static or dynamic assets, to users with low latency and high data transfer speeds. CloudFront accelerates content delivery by caching it at edge locations distributed globally.

### Content Delivery

CloudFront accelerates the distribution of static and dynamic web content, including HTML, CSS, JavaScript, images, videos, and APIs, to users worldwide.

### Global Edge Locations

CloudFront has a network of edge locations strategically located across the globe. These edge locations cache and serve content to end-users, reducing latency and improving performance.

### Low Latency

By caching content at edge locations, CloudFront minimizes the time it takes for users to access resources, resulting in lower latency and improved user experience.

### Scalability

CloudFront scales automatically to handle varying levels of traffic, ensuring reliable and consistent content delivery even during traffic spikes.

### Security

CloudFront integrates with [AWS Identity and Access Management (IAM)](https://www.itwonderlab.com/aws-iam/) and other AWS security services to provide fine-grained control over who can access your content. It supports HTTPS with free certificates from [AWS Certificate Manager](https://www.itwonderlab.com/aws-acm/) (requested in us-east-1), signed URLs and cookies, and [AWS WAF](https://www.itwonderlab.com/aws-waf/) protection. For an [S3](https://www.itwonderlab.com/aws-s3/) origin, **origin access control** keeps the bucket private so that content is only reachable through CloudFront.

### Customization

CloudFront allows content customization and delivery control through features like cache control, origin configuration, and compression settings.

### Origin Fetching

Content can be fetched from various origins, including [Amazon S3 buckets](https://www.itwonderlab.com/aws-s3/), [EC2 instances](https://www.itwonderlab.com/aws-ec2/) or [load balancers](https://www.itwonderlab.com/aws-elastic-load-balancing/), or on-premises servers. CloudFront optimizes content delivery by automatically routing requests to the nearest edge location and fetching content from the origin server if necessary.

### Streaming

CloudFront supports the delivery of streaming content, such as live and on-demand video streaming, using protocols like HTTP Live Streaming (HLS) and Dynamic Adaptive Streaming over HTTP (DASH).

### Custom Domain Names

A distribution has a `*.cloudfront.net` name. To use your own domain, add it as an alternate domain name and create an [alias record in Route 53](https://www.itwonderlab.com/aws-route-53/).

### CDN Analytics

CloudFront provides detailed logs and reports on the usage and performance of the content, helping understand user behavior and optimize content delivery.

### Pricing

Pay-as-you-go for data transferred out to the Internet and requests, with a free tier. Traffic between S3 or other AWS origins and CloudFront is not charged. See the [CloudFront pricing](https://aws.amazon.com/cloudfront/pricing/).

### With Terraform

The resources are `aws_cloudfront_distribution`, `aws_cloudfront_origin_access_control`, `aws_cloudfront_cache_policy` and `aws_cloudfront_function`.
