Repository navigation
CM2: the cache infrastructure from Terraform - #3
Merged
Merged
Conversation
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>
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
CM2 — the cache infrastructure from Terraform.
infra/terraform/cloudflare-r2is 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 theWIRING_CLOUDFLARE_R2secret on thecommerce/<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}insecretEnv, and abuildCommandthat renderswrangler.jsoncfrom the document for$ORUN_ENVIRONMENTbeforeturbo 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 validateis 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