Menu

Codifying scotthavird.com in Terraform
πŸ“°

Codifying scotthavird.com in Terraform

DEV Community: terraformΒ·Scott HavirdΒ·1 day ago
#UJkVSW4C
#devtoterraform#devto#dev#pages#cloudflare
Reading 0:00
15s threshold

Codifying scotthavird.com in Terraform

For years this site lived in two places at once: the Docusaurus repo and a scattering of Cloudflare dashboard clicks. Pages project settings, custom domains, zone security toggles, and an email signup API that only existed in AWS β€” none of it was reviewable in a PR.

That drift is fine until it isn't. I hit the www redirect trap on my own domain. Preview builds failed because Node 18 was still configured in the dashboard while Docusaurus 3.9 requires Node 20. Each fix was another manual change with no audit trail.

So I codified the whole stack in iac/ and retired the GitHub Actions deploy workflow in favor of native Cloudflare Pages builds.

What Moved Into Terraform

The iac/ directory now owns four concerns that used to be split across dashboards:

Concern Resource Why codify it

Site hosting cloudflare_pages_project Build command, Node version, preview branch rules

Zone security null_resource + Cloudflare API SSL strict, HSTS preload, TLS 1.3

Email signup API…

Continue reading β€” create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.