How this site is hosted
Page content
This site is static: plain HTML files generated with Hugo. There is no server to patch.
The path a request takes
browser --https--> Cloudflare DNS --CNAME--> CloudFront (ACM cert) --OAC--> private S3 bucket
- S3: the files live in a private bucket. Block Public Access is on and website hosting is off, so the bucket URL returns 403 if you try to open it directly.
- CloudFront: the CDN in front of the bucket. It reads the bucket through Origin Access Control (OAC), redirects HTTP to HTTPS and adds security headers. It runs on CloudFront’s free flat-rate plan, which includes basic WAF rules.
- ACM: the TLS certificate, for
upl1nk.comand*.upl1nk.com. It has to be in us-east-1 for CloudFront. - Cloudflare: DNS only. The root domain is a CNAME to CloudFront (Cloudflare flattens it).
I skipped Route 53 on purpose. A misconfiguration there cost me about 100 USD in credits on an older account.
Accounts and permissions
- The root user has MFA and no access keys. I don’t use it day to day.
- I log in through IAM Identity Center with my own user.
- Deploys use a separate IAM user that can only write to this bucket and invalidate this distribution. Nothing else.
- Budget alerts at 1, 5 and 10 USD, plus a zero-spend budget.
Deploying
npm run deploy
That runs Hugo, syncs the output to S3 and invalidates the CloudFront cache.
Next
- Move deploys to GitHub Actions with OIDC, so there are no long-lived keys on my PC.