aws-cloudfront
TLDR
Create a cache invalidation for specific paths
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.
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--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 status to change. Invalidations have a cost after the free tier. 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)


