AWS

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

  1. Create an S3 bucket to hold the build output.
  2. Create a CloudFront distribution pointing at the bucket (use OAC; keep the bucket private).
  3. Set up HTTPS with an ACM certificate (in us-east-1).
  4. 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.


← Back to all posts