Destroy managed infrastructure
Unlock the complete study guide + 1,040 practice questions across 16 full exams.
Bundled into the existing HashiCorp Certified: Terraform Associate premium course — no separate purchase.
14-day money-back guarantee — no questions asked.
Included in this chapter:
- What destroy does: apply in destroy mode
- Scoping, previewing, and skipping approval
- Guarding resources with prevent_destroy
- Exam-pattern recognition
Three ways to invoke the destroy planning mode
| Aspect | terraform destroy | terraform apply -destroy | terraform plan -destroy |
|---|---|---|---|
| What it is | Convenience alias for apply -destroy | Apply run in destroy planning mode | Plan run in destroy planning mode |
| Changes real infrastructure? | Yes, after approval | Yes, after approval | No, it is a preview only |
| Prompts for approval? | Yes, unless -auto-approve | Yes, unless -auto-approve | No prompt; nothing is applied |
| Default scope | All managed objects | All managed objects | All managed objects |
| Narrow with -target? | Yes | Yes | Yes |
Decision tree
Cheat sheet
Unlock with Premium — includes all practice exams and the complete study guide.