Skip to content

CM2: the cache infrastructure from Terraform - #3

Merged
pullely merged 1 commit into
mainfrom
orun/CM-3-the-cache-infrastructure
Oct 15, 2026
Merged

pullely merged 1 commit into
mainfrom
orun/CM-3-the-cache-infrastructure

Conversation

@pullely

@pullely pullely commented Oct 14, 2026

Copy link
Copy Markdown
Contributor

CM2 — the cache infrastructure from Terraform. infra/terraform/cloudflare-r2 is the factory's R2 root: one bucket per environment (<prefix><repo>-<env>), state on the platform, a Cloudflare token brokered per run, self-healing adoption of a bucket that already exists, and a wiring document {r2_bucket_name} published post-apply as the WIRING_CLOUDFLARE_R2 secret on the commerce/<env> rung. That bucket is the Next.js incremental cache: every "use cache" entry the storefront writes at request time.

The app component (CM1, #2) already names it: dependsOn: cloudflare-r2, WIRING_CLOUDFLARE_R2_{STAGE,PROD} in secretEnv, and a buildCommand that renders wrangler.jsonc from the document for $ORUN_ENVIRONMENT before turbo run build. The tag cache and the revalidation queue need no root — they are Durable Objects the Worker exports, created by the migration in the wrangler config on the first deploy. terraform init -backend=false && terraform validate is green (cloudflare/cloudflare ~> 4.30, external ~> 2.3). Applying needs a workspace with a Cloudflare connection; the Orun lane stays gated until the product is linked.

🤖 Generated with Claude Code

infra/terraform/cloudflare-r2 is the factory's R2 root — one bucket per
environment, state on the platform, a Cloudflare token brokered per run,
self-healing adoption of an existing bucket — publishing the bucket name
and a wiring document {r2_bucket_name} as the WIRING_CLOUDFLARE_R2 secret.
That bucket is the Next.js incremental cache the storefront writes at
request time. The app component already names it (dependsOn, secretEnv,
the wrangler render in buildCommand); the tag cache and the revalidation
queue are Durable Objects the Worker exports and need no root.
terraform validate is green on the root (cloudflare ~> 4.30).

Orun-Task: CM-3
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@pullely
pullely merged commit 8438933 into main Oct 15, 2026
3 checks passed
@pullely
pullely deleted the orun/CM-3-the-cache-infrastructure branch October 15, 2026 02:01
@pullely pullely mentioned this pull request Oct 15, 2026
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