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.
No, you cannot pass --destroy at the end of a terraform plan request to execute terraform destroy. The correct approach is to use the -destroy flag within the terraform plan command and then apply it separately.
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"
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, 11 months agowanrltw
Highly Voted 2 years, 3 months ago57ee09c
Most Recent 1 month, 1 week agoJHkdigital
6 months, 3 weeks ago090200f
7 months, 3 weeks agoDaminaij
8 months, 1 week agodzhang344
8 months, 3 weeks agoMouszie
9 months, 2 weeks agoEdward2021
9 months, 2 weeks agoSilentH
10 months, 4 weeks agoRyan1002
11 months, 3 weeks agorecep38
1 year agovipulchoubisa
1 year, 2 months agosamimshaikh
1 year, 2 months agoMarch2023
1 year, 9 months agosdm13168
1 year, 9 months agoFawadK
1 year, 10 months ago