A single root configuration manages networking, databases, Kubernetes clusters and application services for one product. Plans take about 20 minutes, a small app change plans against everything, and one mistake can affect all layers. What is the recommended structural fix?
Select an answer to reveal the explanation.
Short Explanation
One giant state is like keeping every tool you own in one toolbox: it's heavy, slow to dig through, and drop it once and everything scatters. You split it by what changes together and what can hurt the most. The trap is -target, a recovery tool, not a daily habit.
Full Explanation
Plan time grows with the number of resources Terraform must refresh and evaluate, and a single state couples the risk of every change to every resource in it. The structural remedy is to decompose the configuration into separate root modules, each with its own state or workspace, grouped by blast radius and change cadence, for example a rarely changed network layer, a database layer, and frequently changed application services. Each layer then plans quickly against only its own resources, permissions can be scoped per layer, and a mistake is contained. Layers exchange values through outputs, read with tfe_outputs or terraform_remote_state, and in HCP Terraform run triggers can sequence them. Raising -parallelism above the default of 10 only increases concurrent operations, which can trigger provider API rate limits and leaves the coupling and blast radius unchanged. Disabling refresh makes Terraform ignore external changes, which produces incomplete or incorrect plans. Routine use of -target is discouraged; it exists for exceptional recovery, and plans that are always partial hide the true state of the configuration. Exam caveat: moving existing resources between states uses import and removed blocks, so the split itself should be planned and reviewed. Operational check: map resources to layers, create the new configurations, migrate one layer at a time, and confirm each layer's plan is clean after migration.