First CloudFront

CDN.

Initial setup

The first CloudFront distribution starts with one origin and one default cache behaviour. Get those right and layer the rest later; trying to set every knob on day one produces config nobody can debug.

Origin configuration

Origin configuration is where most security gaps land. Lock the path so CloudFront is the only way to reach the origin; otherwise users find your origin directly and bypass everything CloudFront provides.

Cache behaviours

Cache behaviours are the cache-correctness surface. Defaults are usually wrong for any non-trivial site; override per path so /api routes bypass cache and /static routes cache aggressively.

Custom domain and TLS

Custom domain and TLS are the public-face surface. ACM cert in us-east-1 (CloudFront's regional restriction), ALIAS in Route 53, verify the chain end-to-end, monitor renewal.

Operating the distribution

Operating CloudFront is its own discipline. Cache hit rate, access logs to S3, invalidation cost, and per-distribution alarms together keep the distribution healthy at scale.