Interview Prep/Terraform/Partial Applies, Version Mismatches and CI Failures

A pipeline runs `terraform apply -target=module.app` "to save time". Weeks later, plans show many unrelated pending changes.

AdvancedTroubleshootingPartial Applies, Version Mismatches and CI Failures
Answer

Likely causes → -target applies only part of the graph; everything else drifts from code, and dependent changes pile up. Terraform warns: Resource targeting is in effect.

Diagnose → Run a full terraform plan and review the accumulated diff.

Fix → Review and apply the full plan in a maintenance window, in steps if needed.

Prevent → Ban -target in CI except for documented recovery runbooks; split large stacks instead of targeting.

All Terraform questions

More on Partial Applies, Version Mismatches and CI Failures