# infra OpenTofu config for the Cloudflare side of the multihost setup in `blog/hugo.toml`: one Cloudflare Pages project, custom domain, and DNS record per language (`mykiwi.blog`, `fr.mykiwi.blog`, `pt.mykiwi.blog`, `ja.mykiwi.blog`, `es.mykiwi.blog`). It assumes `mykiwi.blog` is already a zone in your Cloudflare account - this only manages what's *inside* that zone. Deploys (`wrangler pages deploy public/ --project-name=...`) are out of scope here; this just provisions the projects and domains deploys land on. ## Setup Create a token at https://dash.cloudflare.com/profile/api-tokens (Custom Token, scoped to the `mykiwi.blog` zone) with `Zone:DNS:Edit`, `Zone:Zone:Read`, `Zone:Dynamic Redirect:Edit`, and `Account:Cloudflare Pages:Edit`, then: ```sh export CLOUDFLARE_API_TOKEN=... ``` `cloudflare_account_id` is hardcoded in `variables.tf` (it's not a secret - just an identifier) - override it with `-var` if you're ever applying against a different account. ## Usage From the repo root: ```sh make infra-plan make infra-apply ``` Or directly, from this directory (`nix develop .#infra` for `tofu`): ```sh tofu init tofu plan tofu apply ``` State is local (`terraform.tfstate`, gitignored) - fine for a single person operating this. If that ever changes, move the backend to something shared (e.g. an R2 bucket) before a second person touches this.