+++ title = "Define Cloudflare Pages project resource — build config, output dir, git repo connection or artifact upload" priority = 7 status = "todo" ticket_type = "task" dependencies = ["25c413", "2d1371", "fc9bfd", "e2bd9b"] +++ Infrastructure is managed with OpenTofu using the Cloudflare provider. Configuration lives in `infra/`. Resources include a Cloudflare Worker (API), Cloudflare D1 database (bound to the worker), and a Cloudflare Pages project (UI frontend). Cloudflare Pages hosts the Yew/Wasm frontend. Resolve TRIAGE ticket fc9bfd (Pages build strategy: CI build vs pre-built artifact upload) before implementing this resource. Define the Cloudflare Pages project resource in `infra/pages.tf`: 1. `cloudflare_pages_project` resource for the `quotesdb-ui` project 2. Configure the build settings (build command: `trunk build`, output directory: `dist/`) 3. Connect to the git repository or configure for direct artifact upload (per TRIAGE fc9bfd) Every block must have a comment. - Resolve TRIAGE ticket fc9bfd (Pages build strategy) before choosing git-connected vs artifact upload. - Resolve TRIAGE ticket e2bd9b (SPA routing — 404 fallback) before finalising Pages config. - The output directory must match Trunk's `dist/` output. Run from the `infra/` directory: ```sh tofu validate tofu plan ``` `feat(quotesdb): define Cloudflare Pages project resource in OpenTofu`