To safely view all resources that will be deleted by Terraform, which command should you use?

Prepare for your Terraform Associate Exam with our engaging quiz. Test your knowledge with multiple choice questions and receive detailed explanations to enhance your understanding. Ace your exam with confidence!

Utilizing the command 'terraform plan -destroy' is the appropriate method to review all resources that Terraform will delete. This command generates an execution plan that details what actions Terraform will take if you proceed with the deletion. It allows users to carefully examine the list of resources set for removal before actually executing any destructive changes.

This proactive approach ensures that users have a chance to confirm the implications of their actions, thereby minimizing the risk of unintentionally deleting vital resources. Running this command provides insights into the state of resources and facilitates informed decision-making.

In contrast, executing 'terraform destroy' without any flags directly initiates the delete operation without providing the opportunity for review, which could lead to accidental loss of important infrastructure. Similarly, 'terraform delete' is not a valid command in Terraform's CLI, and 'terraform show -destroy' does not exist as a command that lists deletions. Therefore, 'terraform plan -destroy' stands out as the safest and most informative choice.

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy