Courseiva
Understand Terraform's purposemediumDrag & DropObjective-mapped

TF-004 Understand Terraform's purpose Practice Question

Drag and drop the steps to destroy infrastructure managed by Terraform in the correct order.

Drag steps to the numbered slots on the right, or tap a step then tap a slot.

Steps
Order
1Step 1
2Step 2
3Step 3
4Step 4
5Step 5

Answer choices

Why each option matters

Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.

Correct answer & explanation

Run terraform plan -destroy, then run terraform destroy with confirmation.

Destroy plan previews removal; destroy command with confirmation tears down infrastructure.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • Run terraform plan -destroy, then run terraform destroy with confirmation.

    Why this is correct

    To safely destroy infrastructure, `terraform plan -destroy` first generates an execution plan detailing all resources that will be removed, allowing for a crucial review of the proposed changes. Following this, `terraform destroy` executes this plan, prompting for explicit confirmation to prevent accidental deletion of critical resources. This two-step process ensures transparency and control over irreversible infrastructure modifications.

  • Run terraform destroy, then run terraform plan -destroy.

    Why it's wrong here

    Executing `terraform destroy` immediately initiates the process of tearing down all managed infrastructure without providing a prior review of the specific resources targeted for deletion. Running `terraform plan -destroy` subsequently would be entirely redundant, as the destruction process would either be underway or already completed. This sequence bypasses the essential safety mechanism of previewing destructive actions.

  • Run terraform apply, then run terraform destroy.

    Why it's wrong here

    `terraform apply` is designed to provision or update infrastructure to match the desired state defined in the configuration files, not to remove it. Running `terraform apply` before `terraform destroy` could inadvertently create new resources or modify existing ones, potentially altering the infrastructure state in an unintended way. This action could complicate or even counteract the subsequent destruction process, leading to an inconsistent or undesired outcome.

  • Run terraform plan, then run terraform destroy.

    Why it's wrong here

    A standard `terraform plan` command generates an execution plan showing changes required to bring the infrastructure into alignment with the current configuration, focusing on creation or modification, not explicit destruction. While it provides a preview, it does not specifically detail the resources slated for removal when a `destroy` operation is intended. Proceeding directly to `terraform destroy` after a regular `plan` means foregoing the critical, explicit preview of all resources that will be permanently deleted.

About these practice questions

This TF-004 question is part of Courseiva's 428-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam dumps. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

JA

Written by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

This TF-004 practice question is part of Courseiva's free HashiCorp certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the TF-004 exam.