Terraform Associate Exam QuestionsBrowse all questions from this exam

Terraform Associate Exam - Question 185


What does terraform destroy do?

Show Answer
Correct Answer: A

The terraform destroy command is used to terminate resources defined in the current state file of a Terraform project. It specifically targets the resources that have been tracked and managed by Terraform, as specified in the state file. This command does not affect resources that are not in the state file or those outside the scope of the current Terraform project. Its primary function is to ensure that all managed infrastructure resources are properly destroyed, aligning the actual state with the desired state of having no resources.

Discussion

17 comments
Sign in to comment
dinesh198728Option: A
Sep 9, 2022

The terraform destroy command terminates resources managed by your Terraform project. This command is the inverse of terraform apply in that it terminates all the resources specified in your Terraform state. It does not destroy resources running elsewhere that are not managed by the current Terraform project. https://learn.hashicorp.com/tutorials/terraform/aws-destroy

dinesh198728Option: A
Sep 6, 2022

Must be A

DerekKeyOption: A
Dec 4, 2022

A - Correct Terraform destroy destroys every resource that was created by Terraform - it means every resource stored in terraform.tfstate

donathonOption: A
Sep 6, 2022

I vote for A. The destroy will only delete those that are in the state. Eg. even if you have a new resource configured after the last apply (which would be in the state), it will not delete this resources as it cannot be found in the state.

duffyduckOption: A
Sep 12, 2022

This is a question about Terraform -Destory Command: destroy The terraform destroy command is a convenient way to destroy all remote objects managed by a particular Terraform configuration. While you will typically not want to destroy long-lived objects in a production environment, Terraform is sometimes used to manage ephemeral infrastructure for development purposes, in which case you can use terraform destroy to conveniently clean up all of those temporary objects once you are finished with your work.

dk_2022Option: C
Oct 21, 2022

C is the right answer: The terraform destroy command destroys all of the resources being managed by the current working directory and workspace, using state data to determine which real world objects correspond to managed resources. A destroy behaves exactly like deleting every resource from the configuration

kiran15789Option: A
May 8, 2023

Option C is not correct because the command only destroys the infrastructure defined in the Terraform configuration files, not all infrastructure in the configured Terraform provider.

geekneekOption: C
Sep 7, 2022

I think is C. "The terraform destroy command terminates resources managed by your Terraform project. This command is the inverse of terraform apply in that it terminates all the resources specified in your Terraform state. It does not destroy resources running elsewhere that are not managed by the current Terraform project." https://learn.hashicorp.com/tutorials/terraform/aws-destroy

shopkittyOption: A
Sep 10, 2022

I votes for A

lordogre16Option: C
Sep 19, 2022

It's C "The terraform destroy command is used to destroy the project infrastructure and free up the allocated resources. terraform destroy only destroys the infrastructure for the current project. There are no changes made to the resources allocations running elsewhere." https://www.educative.io/answers/what-is-the-command-to-destroy-infrastructure-in-terraform

lordogre16
Sep 23, 2022

I take this all back it's actually A, it modifies the state file not the set provider

lezgino
Feb 5, 2023

Destroy all infrastructure in the Terraform state file is the correct answer. The terraform destroy command is used to destroy the infrastructure that has been created and managed by Terraform, as described in the Terraform documentation: https://www.terraform.io/docs/commands/destroy.html. A is correct]

alifieOption: A
Oct 17, 2022

A it is

G4ExamsOption: A
Nov 1, 2022

A is right. The rest are distructors

InformationOverloadOption: A
Dec 29, 2022

A - is correct

ZeppoonstreamOption: A
Jan 20, 2023

A. Destroy all infrastructure in the Terraform state file terraform destroy command is used to destroy all infrastructure resources that are managed by Terraform in the current state file. This command will ask for confirmation before proceeding with the destruction and will remove the resources from the provider, and also remove the resources from the state file.

phidelicsOption: A
Mar 22, 2023

destroy all infrastructure

campsOption: A
Mar 31, 2023

A. Destroy all infrastructure in the Terraform state file. Terraform destroy is a command used to destroy all the infrastructure resources that are defined in the Terraform configuration file. This command removes all resources created by the Terraform configuration and deletes them from the infrastructure provider, effectively tearing down the entire infrastructure that was created using Terraform. The command operates on the Terraform state file, which is used to track the current state of the infrastructure. When the command is executed, it removes all resources in the state file and makes the infrastructure match the desired state of having no resources.

Nunyabiznes
Apr 2, 2023

answers are : AC