Which command shows what will be deleted when destroying a Terraform configuration, without applying changes?

Prepare for the HashiCorp Terraform Associate Exam. Utilize flashcards and multiple-choice questions with detailed hints and explanations. Boost your confidence and be ready for success!

Multiple Choice

Which command shows what will be deleted when destroying a Terraform configuration, without applying changes?

Explanation:
Previewing deletions without applying is done with the plan command using the destroy flag. Running terraform plan -destroy creates a dry-run plan that shows exactly which resources would be deleted if you proceeded with a destroy operation or an apply that includes a destroy. This lets you verify deletions without changing anything in your infrastructure. Using plan alone shows the general changes that would occur on the next apply, which can include creates, updates, and deletes, but it isn’t limited to deletions. Terraform destroy would actually delete resources right away, not just show them. Terraform show is for inspecting a plan or state, not specifically for previewing what would be deleted during a destroy operation.

Previewing deletions without applying is done with the plan command using the destroy flag. Running terraform plan -destroy creates a dry-run plan that shows exactly which resources would be deleted if you proceeded with a destroy operation or an apply that includes a destroy. This lets you verify deletions without changing anything in your infrastructure.

Using plan alone shows the general changes that would occur on the next apply, which can include creates, updates, and deletes, but it isn’t limited to deletions. Terraform destroy would actually delete resources right away, not just show them. Terraform show is for inspecting a plan or state, not specifically for previewing what would be deleted during a destroy operation.

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy