Menu

Split Terraform state by blast radius, not by team
📰

Split Terraform state by blast radius, not by team

DEV Community: terraform·Hritik Chaudhary·1 day ago
#da1IkfRM
#devtoterraform#devto#dev#state#change
Reading 0:00
15s threshold

Most teams split Terraform state the way they split org charts: one state per team, or one state per repo. It feels tidy. Then someone runs terraform apply on a Friday and the plan touches the network, the database and three services at once, because they all live in the same state.

A better question to ask when you draw the boundaries: if this apply goes wrong, what is the most it can break?

What goes wrong with one big state

Every plan has to refresh every resource, so it gets slower as the state grows.

A state lock held by one person blocks everyone else, even when their changes are unrelated.

A typo in a small change can still sit next to resources you would never want to touch by accident.

Reviewers see a long plan and start skimming, which is exactly when mistakes get through.

Split by blast radius

Group resources by how much damage a bad change to them can do, and how often they change:

Foundations (accounts, networking, DNS zones, IAM baselines). Change rarely, hurt a lot when wrong.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.