Repository navigation
feat(adopt): self-healing terraform adoption — import existing infra when platform state is empty - #35
Merged
Conversation
…when platform state is empty Config-driven import blocks (kv namespace by title, hyperdrive config by name, supabase project by name+org) whose ids are looked up at plan time by an external data source running inside the job: it first checks the platform state over TF_HTTP_* (already tracked → inert), then asks the provider API with the job's brokered credentials. Fresh products resolve to no-op and create normally. This retires the AWS-dependent tfstate-to-orun.sh migration for these roots: a baseline whose state predates the platform backend adopts its own live infra on first apply — no S3 read, no AWS credentials. random_password is the one resource that cannot be adopted, so the supabase root documents the database-password reset as the cutover: the same run republishes the new credentials through job-output secrets and re-wires every consumer. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
A fork deploying into the same Cloudflare account legitimately keeps the baseline's workers.dev subdomain (worker names are already brand-prefixed). The leftover sweep flagged it anyway, exited 1 mid-bootstrap, and silently skipped every later hook — the intent workspace had to be patched by hand on the nimbus instantiation. The subdomain now joins the residue set only when the values file actually changes it; --verify (fork-side, no values) skips it for the same reason. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…esume bootstrap-flow.yaml replaces the seven batch steps with one main push that un-parks the whole fleet (park.mjs unpark --all; cloudflare-domain stays parked) with feedback edges stripped, rides ONE convergence run to green (flows/converge.sh: gh run rerun --failed resume, budget 3 — CI is exec-id+--retry resume-capable), restores the bindings with a second push, and verifies live endpoints. Preflight now POLLS for active provider connections (10m) so the two OAuth consents can be clicked while the flow runs instead of failing it. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
BOOTSTRAP.md is the operator runbook from blueprint to live baseline (one workflow + two OAuth consents, target under an hour), with the full troubleshooting table from the nimbus instantiation. flows/README.md now describes the single-run flow (no batches, no AWS prerequisite) and the first-boot ordering guarantees that make one convergence run sufficient. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
With --retry unconditional, the v2.49.0 dep-grace made dependents of a genuinely failed upstream wait the full 30-minute dependency deadline on FRESH runs too (observed: hyperdrive/supabase-prod lanes hanging behind the orphaned-secret supabase failure). Gate it on GITHUB_RUN_ATTEMPT > 1: the grace applies exactly where the resume race exists. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.
Follow-up to #34 (merged with the platform state still empty): the kv apply on main fails 10014 on the duplicate namespace title, and supabase/hyperdrive would collide the same way once their lanes unblock.
Each terraform root gains an
adopt.tf: a config-drivenimportblock whose id is looked up at plan time by anexternaldata source running inside the job — it first checks the platform state overTF_HTTP_*(already tracked → inert), then asks the provider API with the job's brokered credentials (KV namespace by title, Hyperdrive config by name, Supabase project by name+org). Fresh products resolve to no-op and create normally.This retires the AWS-dependent
tfstate-to-orun.shmigration for these roots — a baseline whose state predates the platform backend adopts its own live infra on first apply.random_passwordcannot be adopted, so the supabase root documents the database-password reset as the cutover (same run republishes credentials through job-output secrets and re-wires every consumer).Lock files regenerated with linux_amd64/linux_arm64/darwin_arm64 hashes; all three roots
terraform validateclean.🤖 Generated with Claude Code