Skip to content

Terraform State

Buckets

Canonical env-dataops service roots use a state bucket named:

fetch-terraform-state-<account-id>

The current prod account-level root is an exception: terraform/accounts/prod-dataops/backend.tf still points at the legacy data-platform-857967394368/state/infra/account/prod-dataops.tfstate backend. Treat the table below as the target convention for new env-dataops state and for sub-prod account roots, not as proof that every historical account root has already moved.

Key Conventions

Root TypeKey ShapeExample
Service root<service>/us-east-1/terraform.tfstatekyuubi/us-east-1/terraform.tfstate
Account rootaccounts/<env>-dataops/data-platform/us-east-1/terraform.tfstateaccounts/stage-dataops/data-platform/us-east-1/terraform.tfstate

Backend Migration Pattern

For existing production state, use this order:

  1. Verify a no-op plan on the current backend.
  2. Back up the state object in S3.
  3. Download a local state backup and inspect it.
  4. Copy the state object to the new backend key.
  5. Switch backend/provider code.
  6. Run a protected no-op plan.
  7. Run a protected no-op apply.
  8. Run runtime smoke tests after the backend migration.

Checked Against

  • implementations/2026-05-21-dl-419-prod-dataops-runtime-progress.md.
  • implementations/2026-05-26-dl-388-terraform-cutover-progress.md.
  • terraform/accounts/*/backend.tf on origin/main, including the current prod account-root legacy backend exception.