Exam Terraform Associate All QuestionsBrowse all questions from this exam
Question 30

You have used Terraform to create an ephemeral development environment in the cloud and are now ready to destroy all the infrastructure described by your

Terraform configuration. To be safe, you would like to first see all the infrastructure that will be deleted by Terraform.

Which command should you use to show all of the resources that will be deleted? (Choose two.)

    Correct Answer: A, D

    CD

    Reference:

    https://www.terraform.io/docs/cli/commands/state/rm.html

Discussion
IpergortaOptions: AD

The answer is A,D

ItaloVinodiOptions: AD

We need to choose two so AD

AzRNoobOptions: AD

A. Run terraform plan -destroy. This command will generate a plan that shows all of the changes Terraform will make to the infrastructure, including any resources that will be destroyed. The -destroy flag specifies that only the changes that will result in the destruction of resources should be shown. Option D is also partially correct, as running terraform destroy will output a list of resources that will be destroyed before prompting for approval. However, it is generally recommended to run terraform plan -destroy first to preview the changes before actually executing them with terraform destroy. Option B is incorrect, as it is possible to show resources that will be deleted using the terraform plan -destroy command. Option C is also incorrect, as running terraform state rm * will remove all resources from the Terraform state file, effectively "forgetting" about them and making it impossible to manage them with Terraform.

vj_dhakshOptions: AD

Answer is AD C - incorrect as running "terraform state rm *" throws error stating variable required (* wont pick all)

Shane_COptions: AD

AD are correct

ravi135Options: AD

answer AD

karendavtyanOption: A

A. Run terraform plan -destroy.

karendavtyanOptions: AD

D. Run terraform destroy and it will first output all the resources that will be deleted before prompting for approval.

Ni33Options: AD

A and D are correct.

Bluemoon22Options: AD

A is only to show the resources will be destroyed, terraform plan -destroy D is a common operation from terraform destroy

FaaizzOptions: AD

A & D are correct here

connecttozeeOptions: AD

100% is AD

Power123Options: AD

A and D are correct

r1ckOptions: AD

https://developer.hashicorp.com/terraform/cli/commands/destroy AD

andersonbispos42Options: AD

The answer is A, D

andersonbispos42Option: A

The answer is only A

vikramvlrOptions: AD

Correct answer - AD