A failed apply left half the resources created. What do you do?
IntermediateScenarioTesting Upgrades and Large-Scale Operations
Answer
Situation read → Partial apply: Terraform saves progress to state as it goes.
What I'd do →
- Read the error; fix the cause (permissions, quota, name collision).
- Re-run
terraform plan; it plans only what's missing. - If a resource was created but not recorded (timeout),
importit before applying. - Apply again.
Why → Terraform is convergent: re-applying finishes the job.
Interview tip → Check for tainted resources in the plan.
More on Testing Upgrades and Large-Scale Operations
What does each of `terraform validate`, `plan` and `terraform test` actually check?BeginnerWrite a native test for a module that creates an encrypted S3 bucket.IntermediateCompare Terratest with `terraform test`.IntermediateReal-cloud integration tests leave orphaned resources when they fail midway. How do you handle that?AdvancedHow do you upgrade from Terraform 1.5 to 1.9 safely?IntermediateMajor AWS provider upgrade from v4 to v5 (or v5 to v6) across many stacks. How do you plan it?Advanced