Skip to content

AV2: the KV namespace from Terraform - #3

Merged
ruehowl merged 1 commit into
mainfrom
av2-kv
Oct 29, 2026
Merged

ruehowl merged 1 commit into
mainfrom
av2-kv

Conversation

@ruehowl

@ruehowl ruehowl commented Oct 29, 2026

Copy link
Copy Markdown
Contributor

What (AV-3)

infra/terraform/cloudflare-kv is the Cirrus KV root, as in kv-redis-starter and ai-artifacts:

  • It creates one KV namespace per deployed environment (stage and prod), titled <prefix><repo>-app-kv-<env>. The title is unique per product, so two products can share an account.
  • It adopts a namespace Cloudflare already holds under that title when the platform state does not track it (adopt.tf).
  • After apply, it lease-publishes WIRING_CLOUDFLARE_KV (app_kv_id, app_kv_title). The site's build reads it back as WIRING_CLOUDFLARE_KV_<ENV> and renders the VISIBILITY_CACHE binding from app_kv_id.
  • web depends on it: the edge is enforced on a push to main and advisory on a pull request.

Verified locally

  • terraform init -backend=false && terraform validate passes, and so does terraform fmt -check.
  • orun catalog validate (v2.89.0) reports 0 errors.

Generated by Claude Code

infra/terraform/cloudflare-kv provisions one KV namespace per deployed
environment (stage and prod), titled from the product's repository slug so
two products can share an account, and adopts one Cloudflare already holds
under that title when the platform state does not track it. After its apply
it lease-publishes the wiring document (app_kv_id, app_kv_title) as
WIRING_CLOUDFLARE_KV, which the site's build reads back as
WIRING_CLOUDFLARE_KV_<ENV> to render the VISIBILITY_CACHE binding. web's
edge on it is enforced on main and advisory on a pull request.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019PcpNVpFBcbeiX3EHdXfmn
@ruehowl
ruehowl merged commit 05a30d9 into main Oct 29, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants