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

Exam Terraform Associate All Questions

View all questions & answers for the Terraform Associate exam

Exam Terraform Associate topic 1 question 199 discussion

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

Terraform destroy is the only way to remove infrastructure.

  • A. True
  • B. False
Show Suggested Answer Hide Answer
Suggested Answer: B 🗳️

Comments

Chosen Answer:
This is a voting comment (?) , you can switch to a simple comment.
Switch to a voting comment New
Basavaraju_V
Highly Voted 1 year, 8 months ago
B. by commenting the resource block in the configuration file will also destroy the resources
upvoted 6 times
...
ramzez4815
Most Recent 1 year, 1 month ago
Selected Answer: B
False: the primary way to delete infrastructure managed by Terraform is to remove the corresponding declarations from your configuration and run terraform apply. terraform destroy (or, equivalently, terraform apply -destroy) is for the less common situation where you want to destroy everything managed by a particular configuration, which is not an everyday operation for long-lived infrastructure but can be useful for short-lived infrastructure such as one-time testing environments. https://discuss.hashicorp.com/t/is-terraform-destroy-the-only-way/36619/4
upvoted 3 times
...
Pietjeplukgeluk
1 year, 9 months ago
"terraform apply -destroy" would be an alias for "terraform destroy" B for sure
upvoted 4 times
...
ArizonaClassics
1 year, 10 months ago
B for Sure
upvoted 1 times
...
nakikoo
1 year, 10 months ago
correct, you can also remove the resource definition in the state file if you previously stated it, it will detect the resource definition is absent and will delete the resource Unless you state the resource, but someone delete it manually, it will recreate it
upvoted 1 times
JohnGasp
1 year, 4 months ago
if you remove just from state, terrafrom will forgot about resource and just create new one on next apply, so first instance will not be deleted
upvoted 1 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 ...