Terraform Associate Exam QuestionsBrowse all questions from this exam

Terraform Associate Exam - Question 116


You have created a main.tr Terraform configuration consisting of an application server, a database, and a load balancer. You ran terraform apply and all resources were created successfully. Now you realize that you do not actually need the load balancer so you run terraform destroy without any flags What will happen?

Show Answer
Correct Answer: B

When you run terraform destroy without any flags, Terraform will prompt you to confirm that you want to destroy all the infrastructure. This is a safety measure to prevent accidental destruction of resources. You will need to enter 'yes' to proceed with the destruction. If you wanted to bypass this confirmation, you would need to use the '-auto-approve' flag.

Discussion

6 comments
Sign in to comment
SilentMilliOption: B
Mar 15, 2023

Terraform will prompt you to confirm that you want to destroy all the resources before proceeding. The prompt will ask you to enter "yes" or "no" to confirm or cancel the destruction of resources unless you add the "-auto-approve" flag to stop terraform from prompting you to confirm.

BurakkoOption: B
Sep 1, 2022

The answer is B.

bora4motionOption: B
Sep 1, 2022

I go with B

ozbeyucelOption: B
Jan 29, 2023

It is B, however, E is tricky there. can confuse

ajbffkabf
Jun 18, 2023

xxxxxxxxxxxxxxx

090200fOption: B
Jul 15, 2024

B is correct ans. first it will ask you yes or no then if we enter yes , destroy all the resources