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 142 discussion

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

Which of the following is not a way to trigger terraform destroy?

  • A. Using the destroy command with auto-approve
  • B. Running terraform destroy from the correct directory and then typing "yes" when prompted in the CLI
  • C. Passing --destroy at the end of a plan request
  • D. Delete the state file and run terraform apply
Show Suggested Answer Hide Answer
Suggested Answer: C 🗳️

Comments

Chosen Answer:
This is a voting comment (?) , you can switch to a simple comment.
Switch to a voting comment New
lizzard812
Highly Voted 1 year, 7 months ago
The real exam gives options either apply -destroy or delete state file + plan, so obviously plan does not destroy anything, so I went with this. The examtopics question here is misspelled. So you won’t be confused that much on real exam.
upvoted 18 times
...
wanrltw
Highly Voted 1 year, 11 months ago
I'd go with D. The `terraform plan -destroy` command will only show what is going to be destroyed (it’s only a plan). However, removing the state file has nothing to do with `terraform destroy` at all - it would only make Terraform forget about its objects while they continue to exist in the remote system.
upvoted 15 times
...
JHkdigital
Most Recent 3 months ago
Selected Answer: D
Absolutely D
upvoted 1 times
...
090200f
4 months ago
option D is correct answer
upvoted 1 times
...
Daminaij
4 months, 3 weeks ago
Plan don’t destroy anything
upvoted 1 times
...
dzhang344
5 months ago
Selected Answer: C
execute plan doesn't trigger destroy
upvoted 1 times
...
Mouszie
5 months, 3 weeks ago
will go for D
upvoted 1 times
...
Edward2021
5 months, 4 weeks ago
"is not a way to do " - ill take A.. you shouldn't do destroy without being sure what you are destroying..
upvoted 1 times
...
SilentH
7 months, 1 week ago
Selected Answer: C
Because there is no double-dash destroy (hoping this isn’t a typo)
upvoted 1 times
...
Ryan1002
8 months ago
Selected Answer: D
Destroy mode: creates a plan whose goal is to destroy all remote objects that currently exist, leaving an empty Terraform state. It is the same as running terraform destroy. Destroy mode can be useful for situations like transient development environments, where the managed objects cease to be useful once the development task is complete. Activate destroy mode using the -destroy command line option.
upvoted 1 times
...
recep38
9 months ago
I tested in a lab. When you run "terraform plan -destroy" it just shows which resource will be destroyed but didnt destroy anything. If you want to destroy you should run "terraform destroy". But interestingly When you delete state file and run "terraform apply" command it creates a new resources not destroy. It seems two options are correct. C and D.
upvoted 2 times
...
vipulchoubisa
10 months, 2 weeks ago
delete state file is never suggested by terraform so simple, answer is D.
upvoted 1 times
...
samimshaikh
10 months, 4 weeks ago
Selected Answer: C
Answer is C because there is no such command to trigger a destroy "terrafrom destroy --destroy" A & B are way to trigger a destroy. D: will not suite because in the question it has mentioned that "way of triggering a destroy" instead of "way of destroy"
upvoted 1 times
...
March2023
1 year, 5 months ago
Selected Answer: D
im going with D
upvoted 1 times
...
sdm13168
1 year, 6 months ago
Selected Answer: D
D, if you delete the state file, then run terraform apply, terraform will try to create the whole infrastructure but get error.
upvoted 1 times
...
FawadK
1 year, 6 months ago
Selected Answer: D
D makes more sense than C. Correct answer should be D
upvoted 1 times
...
zanhsieh
1 year, 6 months ago
Selected Answer: D
D. C: Wrong. "Destroy mode: creates a plan whose goal is to destroy all remote objects that currently exist, leaving an empty Terraform state. It is the same as running terraform destroy." https://developer.hashicorp.com/terraform/cli/commands/plan#planning-modes
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 ...