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.
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.
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.
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.
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"
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
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.
lizzard812
Highly Voted 1 year, 7 months agowanrltw
Highly Voted 1 year, 11 months agoJHkdigital
Most Recent 3 months ago090200f
4 months agoDaminaij
4 months, 3 weeks agodzhang344
5 months agoMouszie
5 months, 3 weeks agoEdward2021
5 months, 4 weeks agoSilentH
7 months, 1 week agoRyan1002
8 months agorecep38
9 months agovipulchoubisa
10 months, 2 weeks agosamimshaikh
10 months, 4 weeks agoMarch2023
1 year, 5 months agosdm13168
1 year, 6 months agoFawadK
1 year, 6 months agozanhsieh
1 year, 6 months ago