← All decisions jacob@stephens.page
Decision Record

Keep Terraform state off the provider it provisions

ADR 0015 · Accepted ยท in production · ~468 words

Context

Terraform records what it manages in a state file that has to live somewhere durable and lockable. The compute it describes - a droplet, a block volume, the DNS in front of them - runs on one cloud provider that also sells an S3-compatible object store, so the path of least resistance is a bucket on the same account: one vendor, one set of credentials, one bill.

That convenience hides a coupling. State matters most when you need to rebuild, and the most total failure is losing the provider itself: a region outage, a billing lock, a suspended account. State on that same provider means the one event takes out both the infrastructure and the record of how to recreate it. Same instinct as not storing the only backup on the machine being backed up: recovery state should not share a failure domain with the thing it recovers.

Decision

Put the state on a different provider than the compute it describes.

Consequences

When I'd revisit

If the state describes resources whose own provider you would necessarily be recovering through anyway - so the independence buys nothing - same-cloud storage can win on simplicity. A compliance boundary requiring data, state included, to stay within one cloud or region would also override this. Short of those, keep the failure domains apart: a few dollars of IAM setup beats co-locating the recovery plan with the disaster.

Narrative writeup: Importing Live DNS into Terraform Without Downtime. One of a set of architecture decision records. Source markdown lives in the infrastructure-patterns repo, which is the canonical copy.