aws-cloudfront
Manage content delivery network distributions and caching.
TLDR
SYNOPSIS
aws cloudfront command [options]
DESCRIPTION
aws cloudfront manages Amazon CloudFront, a content delivery network (CDN) that caches content at edge locations worldwide for low-latency delivery.Invalidations remove cached objects from edge locations before their TTL expires. Paths support wildcards (/images/*) to invalidate multiple files. The first 1,000 invalidation paths per month are free.Distributions define origins (S3, ALB, custom HTTP), cache behaviors, SSL certificates, and other delivery settings. Changes propagate globally and may take 15-30 minutes.Origin Access Control (OAC) secures S3 origins by restricting direct bucket access, requiring requests to go through CloudFront.CloudFront Functions and Lambda@Edge allow running code at edge locations to customize request/response handling.Use quotes around paths with wildcards in shell commands to prevent glob expansion.
PARAMETERS
create-invalidation
Invalidate cached objects in edge locationslist-invalidations
List invalidation requests for a distributionget-invalidation
Get status of an invalidation requestcreate-distribution
Create a new CloudFront distributionget-distribution
Get distribution configuration and statuslist-distributions
List all distributions in the accountupdate-distribution
Modify distribution settingsdelete-distribution
Remove a distribution (must be disabled first)create-origin-access-control
Create OAC for secure S3 access.get-distribution-config
Get only the distribution configuration (without status metadata).create-function
Create a CloudFront Function for lightweight edge compute.sign
Sign CloudFront URLs or cookies for private content.wait
Wait for a distribution to reach a specific state (e.g., deployed).--distribution-id id
Distribution identifier (e.g., EDFDVBD6EXAMPLE)--paths paths
Space-separated paths to invalidate (supports wildcards with *)--invalidation-batch json
JSON with paths and caller reference--distribution-config json
Distribution configuration file--id id
Resource identifier (invalidation, distribution)--if-match etag
ETag for conditional updates/deletes
CAVEATS
Distribution deletion requires disabling first, then waiting for the status to change to `Deployed`. Invalidations have a cost after the first 1,000 paths per month. Distribution changes take time to propagate globally. Config updates require the current ETag value via --if-match.
HISTORY
Amazon CloudFront launched in November 2008 as AWS's content delivery network service. It has grown from basic static content delivery to support dynamic content, streaming, WebSocket, and serverless compute at the edge via Lambda@Edge (2016) and CloudFront Functions (2021).
SEE ALSO
aws(1), aws-s3(1), aws-acm(1), aws-route53(1)
