posts /
How This Blog Is Built (and Why It's Boring on Purpose)
A private S3 bucket, CloudFront, a free TLS certificate and Hugo. About a dollar a month, nothing to patch, and very little that can break.
Every developer blog’s first post is about how the blog is built. This is that post, but with the costs, the tradeoffs and the parts that tripped me up.
The claim#
The architecture#
reader ──HTTPS──▶ CloudFront ──signed──▶ private S3 bucket
│
└─ Function: www → apex
/post/ → /post/index.html- Route 53 points
theskepticaldev.comat CloudFront. - ACM issues the TLS certificate, for free.
- S3 holds the built site. The bucket is private; only this one CloudFront distribution can read it.
- Terraform describes all of the above, so it can be rebuilt from scratch.
Locking the bucket to one distribution#
CloudFront signs every request it sends to S3 (Origin Access Control). The bucket policy then only accepts requests that come from this distribution:
condition {
test = "StringEquals"
variable = "AWS:SourceArn"
values = [aws_cloudfront_distribution.site.arn]
}Without that condition, any CloudFront distribution in any AWS account could read the bucket.
Pretty URLs#
Hugo writes /posts/how-this-blog-is-built/index.html, but readers visit /posts/how-this-blog-is-built/. S3 doesn’t fill in index.html when accessed this way, so a small CloudFront Function does it on every request:
var uri = request.uri;
if (uri.endsWith("/")) {
request.uri = uri + "index.html";
} else if (!uri.split("/").pop().includes(".")) {
request.uri = uri + "/index.html";
}Publishing a post#
hugo new content posts/2026-12-10-some-topic/index.md
hugo server -D # preview locally, drafts included
git commit -am "Add: some topic" && git pushOn push, GitHub Actions builds the site, syncs it to S3 and clears the CloudFront cache. It authenticates with short-lived credentials (OIDC), so no AWS keys are stored in GitHub.
| Files | Cache-Control | Why |
|---|---|---|
css/*, js/* | max-age=31536000, immutable | File names contain a content hash, so a change means a new URL |
| Everything else | max-age=300, s-maxage=86400 | Browsers re-check after 5 minutes; CloudFront is cleared on every deploy |
What it costs#
| Item | Monthly cost |
|---|---|
| Route 53 hosted zone | $0.50 |
| ACM certificate | $0 |
| CloudFront (1 TB and 10M requests free) | $0 at blog-scale traffic |
| S3 storage and requests | A few cents |
Tradeoffs#
- No comments and no search, yet. Both can be added later without a server (for example, Pagefind for search).
- Every change is a rebuild. For a blog that takes seconds, so it doesn’t matter.
- Scheduled posts need a scheduled build. A post dated in the future only appears after the next build, so the pipeline also runs once a day.
If any of this turns out to be wrong, the link below goes straight to this post’s source.