Hosting a static site with AWS S3 + CloudFront
How to put a static site on S3 and serve it through CloudFront cheaply.
For a static site (like this blog), S3 + CloudFront is cheap, fast, and reliable.
The main steps
- Create an S3 bucket to hold the build output.
- Create a CloudFront distribution pointing at the bucket (use OAC; keep the bucket private).
- Set up HTTPS with an ACM certificate (in us-east-1).
- On each deploy:
aws s3 sync, then create an invalidation to clear the cache.
Why CloudFront
- Global CDN → fast loads everywhere.
- Free HTTPS via ACM.
- Caching reduces load and cost.
This is exactly how this blog is deployed.