Interview Prep/Terraform/Workflow and CLI

Why is `-target` considered dangerous?

AdvancedConceptWorkflow and CLI
Answer

-target limits the plan to chosen resources and their dependencies, ignoring everything else. State and reality can drift from the code, and Terraform warns that it is "not for routine use". It is for recovery cases such as breaking a dependency cycle or applying a broken resource first. If you use it routinely, your root module is too big.

terraform apply -target='module.network.aws_subnet.private["a"]'
All Terraform questions Roadmap: Terraform

More on Workflow and CLI