Which command is used to remove Terraform-managed infrastructure?

Master the HashiCorp Terraform Test with these flashcards and multiple choice questions. Each question includes hints and explanations to prepare you effectively. Set yourself up for success!

The command used to remove Terraform-managed infrastructure is indeed "terraform destroy." This command is designed to take down all resources defined in the Terraform configuration files, effectively cleaning up the infrastructure that has been provisioned. When executed, it reads the state of the infrastructure, compiles a list of resources to be destroyed, and prompts the user for confirmation before proceeding with the deletion.

The "terraform destroy" command ensures that all dependencies and relationships among resources are respected, preventing orphaned resources and ensuring a clean removal of the infrastructure. This includes stopping and deleting virtual machines, security groups, databases, or any other resources that Terraform has provisioned based on your configuration.

The other choices refer to commands that do not exist in Terraform’s command set for managing resources. Concepts like "terraform remove," "terraform delete," and "terraform purge" do not perform the function of destroying infrastructure in Terraform, thereby making it clear why "terraform destroy" is the only correct choice for removing managed infrastructure.

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy