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

An apply failed halfway: 14 resources created, then `Error: creating RDS DB Instance ... InvalidParameterCombination`. What state are you in?

BeginnerTroubleshootingPartial Applies, Version Mismatches and CI Failures
Answer

Likely causes → Terraform doesn't roll back. Resources created before the failure are in state; the failed one is not (or is tainted if it was created but a later wait failed).

Diagnose →

terraform state list | wc -l
terraform plan    # shows only what is still missing or tainted

Fix → Fix the cause (here, an invalid engine/instance class combination) and re-apply. Terraform continues from where it stopped.

Prevent → terraform validate and dev-environment applies catch most parameter errors; keep stacks small so partial failures are easy to reason about.

All Terraform questions

More on Partial Applies, Version Mismatches and CI Failures