Which command will show all resources that would be deleted if you proceed with destruction?

Prepare for the HashiCorp Terraform Associate Exam with quizzes, flashcards, and multiple-choice questions. Each question includes hints and explanations. Boost your confidence and ace your exam!

Multiple Choice

Which command will show all resources that would be deleted if you proceed with destruction?

Explanation:
Previewing destructive changes before applying them is crucial to avoid accidental deletions. Running the plan command with the -destroy flag asks Terraform to generate a what-if execution plan for destroying resources, but without making any changes. It will list every resource that would be deleted, so you can review and confirm exactly what would be removed if you proceed. This explicit preview is why it’s the best choice: it provides a clear, non-destructive view of the destruction scope. While the destroy action will eventually remove resources and typically shows what will be destroyed before you confirm, plan -destroy is specifically designed to display that impact without performing any deletions, making it the most reliable way to see all resources that would be deleted.

Previewing destructive changes before applying them is crucial to avoid accidental deletions. Running the plan command with the -destroy flag asks Terraform to generate a what-if execution plan for destroying resources, but without making any changes. It will list every resource that would be deleted, so you can review and confirm exactly what would be removed if you proceed. This explicit preview is why it’s the best choice: it provides a clear, non-destructive view of the destruction scope.

While the destroy action will eventually remove resources and typically shows what will be destroyed before you confirm, plan -destroy is specifically designed to display that impact without performing any deletions, making it the most reliable way to see all resources that would be deleted.

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy