Tools Practical By Samson Tanimawo, PhD Published May 27, 2026 4 min read

Terraform Cheats for Debugging

Reading plan output, fixing state, recovering from broken applies. The terraform commands worth memorising.

Reading plans

terraform plan -out=plan.tfplan saves the plan; terraform show plan.tfplan reads it.

Diff before apply; the surprise is in the diff.

State surgery

terraform state list shows resources; terraform state rm removes one without destroying.

Use when state drifts from reality and you need to re-import.

Import

terraform import addr id pulls existing resources into state.

Useful for recovering from manually-created resources.