Repository navigation
TB2: the KV namespace from Terraform - #3
Merged
Merged
Conversation
kv-redis-starter's infra/terraform/cloudflare-kv root, renamed: one Workers KV namespace per environment (<prefix>telegram-ai-bot-app-kv-<env>, built on the product's slug so two products in one account never collide), a namespace of the same title adopted instead of colliding, and its id and title published as the WIRING_CLOUDFLARE_KV document the Worker's config renders from. The Cloudflare provider authenticates with the brokered workers-deploy token, as kv-redis-starter's does. apps/bot now waits on it: an enforced dependsOn on a push to main (advisory on a pull request), so one convergence applies the namespace, then deploys the Worker bound to it, per environment — stage and prod each after their own apply. Checked: terraform validate; orun plan orders cloudflare-kv → bot per environment; catalog docs regenerated. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019PcpNVpFBcbeiX3EHdXfmn
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.
The KV namespace the bot binds as
DATABASE, provisioned per environment (TB-3).infra/terraform/cloudflare-kv: kv-redis-starter's root, renamed — one Workers KV namespace per environment (<prefix>telegram-ai-bot-app-kv-<env>, built on the product's slug so two products in one account never collide), a namespace of the same title adopted rather than colliding, and its id and title published as theWIRING_CLOUDFLARE_KVdocument the Worker's config renders from. The provider authenticates with the brokered workers-deploy token, as kv-redis-starter's does.apps/botwaits on it: an enforceddependsOnon a push to main (advisory on a pull request), so one convergence applies the namespace, then deploys the Worker bound to it, per environment.Checked locally:
terraform validate;orun plan --trigger github-push-mainorderscloudflare-kv→boton stage and on prod (prod after stage);orun catalog validate0 errors; component docs regenerated.Generated by Claude Code