Skip to content

TB2: the KV namespace from Terraform - #3

Merged
ruehowl merged 1 commit into
mainfrom
tb/2-the-kv-namespace
Oct 28, 2026
Merged

ruehowl merged 1 commit into
mainfrom
tb/2-the-kv-namespace

Conversation

@ruehowl

@ruehowl ruehowl commented Oct 28, 2026

Copy link
Copy Markdown
Contributor

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 the WIRING_CLOUDFLARE_KV document the Worker's config renders from. The provider authenticates with the brokered workers-deploy token, as kv-redis-starter's does.
  • apps/bot 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.

Checked locally: terraform validate; orun plan --trigger github-push-main orders cloudflare-kv → bot on stage and on prod (prod after stage); orun catalog validate 0 errors; component docs regenerated.


Generated by Claude Code

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
@ruehowl
ruehowl merged commit bfdf972 into main Oct 28, 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