For production Terraform setups, how do you organize state within each environment? Do you keep networking, DNS, Kubernetes clusters, and databases in one state, or split them into independent layers such as dev/01-networking, dev/02-dns, dev/03-eks, and dev/04-database, with a separate state file for each? I'm particularly interested in how you balance modularity, state-lock contention, blast radius, ownership, and operational complexity.
4 Answers
Separate states per environment and stack have worked well for us. A stack should represent a coherent unit with clear ownership and a manageable change scope. This makes reviews and selective applies safer, especially when an urgent or previously unreviewed change needs to be isolated.
Separating layers can make plans faster and reduce state-lock contention when multiple teams work at the same time. It also helps when different parts of the platform need different execution environments—for example, public runners handling initial networking while private runners create resources inside a private cluster. Just avoid creating so many tiny states that ordinary changes become cumbersome.
A useful rule is to keep resources together when they’re provisioned and removed together. Otherwise, split state around failure domains, ownership, and how frequently components change. Networking, clusters, and databases are often good candidates for separate states so routine application changes don’t risk critical infrastructure.
There isn’t one universal layout. A structure like dev/landing-zone, dev/app1, and dev/app2 can work well when each stack has clear ownership and a limited blast radius. Organizing by application or use case is often more practical than organizing strictly by resource type.

Related Questions
Can't Load PhpMyadmin On After Server Update
Redirect www to non-www in Apache Conf
How To Check If Your SSL Cert Is SHA 1
Windows TrackPad Gestures