AWS S3 and CloudFront for static asset hosting

5459
0

AWS S3 stores static assets with high durability and availability. Bucket policies control access with JSON policy documents. CloudFront CDN distributes assets globally with edge caching. Origin Access Control (OAC) restricts S3 access to CloudFront only. cache-control headers and TTLs control caching behavior. Invalidation with /* clears CDN cache after deployments. S3 versioning enables rollback of assets. Lifecycle rules transition old versions to cheaper storage or delete them. CORS configuration allows cross-origin requests. Server-side encryption with SSE-S3 or SSE-KMS protects data at rest. CloudFront functions run lightweight logic at the edge for headers or redirects. Terraform provisions the complete stack declaratively.