Welcome to ExamTopics
ExamTopics Logo
- Expert Verified, Online, Free.

Unlimited Access

Get Unlimited Contributor Access to the all ExamTopics Exams!
Take advantage of PDF Files for 1000+ Exams along with community discussions and pass IT Certification Exams Easily.

Exam Terraform Associate topic 1 question 185 discussion

Actual exam question from HashiCorp's Terraform Associate
Question #: 185
Topic #: 1
[All Terraform Associate Questions]

What does terraform destroy do?

  • A. Destroy all infrastructure in the Terraform state file
  • B. Destroy all Terraform code files in the current directory while leaving the state file intact
  • C. Destroy all infrastructure in the configured Terraform provider
  • D. Destroy the Terraform state file while leaving infrastructure intact
Show Suggested Answer Hide Answer
Suggested Answer: D 🗳️

Comments

Chosen Answer:
This is a voting comment (?) , you can switch to a simple comment.
Switch to a voting comment New
dinesh198728
Highly Voted 1 year, 7 months ago
Selected Answer: A
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
upvoted 15 times
...
kiran15789
Most Recent 11 months, 2 weeks ago
Selected Answer: A
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.
upvoted 2 times
...
Nunyabiznes
1 year ago
answers are : AC
upvoted 1 times
...
camps
1 year ago
Selected Answer: A
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.
upvoted 1 times
...
phidelics
1 year ago
Selected Answer: A
destroy all infrastructure
upvoted 1 times
...
Zeppoonstream
1 year, 3 months ago
Selected Answer: A
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.
upvoted 1 times
...
InformationOverload
1 year, 3 months ago
Selected Answer: A
A - is correct
upvoted 1 times
...
DerekKey
1 year, 4 months ago
A - Correct Terraform destroy destroys every resource that was created by Terraform - it means every resource stored in terraform.tfstate
upvoted 3 times
...
G4Exams
1 year, 5 months ago
Selected Answer: A
A is right. The rest are distructors
upvoted 1 times
...
dk_2022
1 year, 6 months ago
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
upvoted 2 times
...
alifie
1 year, 6 months ago
Selected Answer: A
A it is
upvoted 1 times
...
lordogre16
1 year, 7 months ago
Selected Answer: C
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
upvoted 1 times
lordogre16
1 year, 6 months ago
I take this all back it's actually A, it modifies the state file not the set provider
upvoted 1 times
...
lezgino
1 year, 2 months ago
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]
upvoted 1 times
...
...
duffyduck
1 year, 7 months ago
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.
upvoted 2 times
...
shopkitty
1 year, 7 months ago
Selected Answer: A
I votes for A
upvoted 1 times
...
geekneek
1 year, 7 months ago
Selected Answer: C
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
upvoted 1 times
...
dinesh198728
1 year, 7 months ago
Selected Answer: A
Must be A
upvoted 3 times
...
donathon
1 year, 7 months ago
Selected Answer: A
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.
upvoted 2 times
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...