Blog
How I run static sites on S3 and CloudFront
Brochure and consulting sites do not need a Node server in production. They need HTTPS, fast global edge caching, and a boring deploy path.
Stack
- Astro SSG with
trailingSlash: 'always'and directory output. - Private S3 bucket as origin (no public website endpoint).
- CloudFront with Origin Access Control, HTTPS redirect, and a viewer-request function that maps
/about/→/about/index.html. - ACM certificate in
us-east-1(required for CloudFront). - Namecheap DNS CNAMEs — leave MX/TXT alone for Google Workspace email.
- GitHub Actions OIDC → IAM role →
s3 sync+ CloudFront invalidation. Push tomaindeploys preview; a GitHub Release deploys production.
Reusable OpenTofu modules (static-site, github-oidc-deploy) live in the RMZI-Tech modules repo so each site is a thin consumer stack.
This site and ajrsurvey.com share that pattern. If you want the same for your firm site, get in touch.