Terraform Associate Exam QuestionsBrowse all questions from this exam

Terraform Associate Exam - Question 115


A junior admin accidentally deleted some of your cloud instances. What does Terraform do when you run terraform apply?

Show Answer
Correct Answer: C

When you run 'terraform apply', Terraform compares the current state of your infrastructure with the desired state specified in your configuration files. If any instances are found to be missing, Terraform will recreate only those instances to match the desired state. It does not rebuild the entire infrastructure, nor does it stop and generate an error. Terraform's purpose is to ensure the actual state matches the desired state as defined in your configuration files, and it will take appropriate actions to achieve this.

Discussion

10 comments
Sign in to comment
legendary7Option: C
Sep 29, 2022

C Terraform would refresh and check that the Current State in the state file is not thesame as the Desired State. Terraform will check its configuration resource files and if it finds a resource that is present in the state file but not in the Desired state, it will create it

shopkittyOption: C
Sep 8, 2022

vote for C

BurakkoOption: C
Sep 1, 2022

the correct answer is C.

amanpOption: C
Sep 5, 2022

Answer is C.

adoubanOption: C
Dec 12, 2022

Deleting instance from cloud console will result terraform to create instance again to match what written in tf config files

Power123Option: C
Mar 31, 2023

C is correct

Ni33Option: C
May 9, 2023

C is the correct answer !

duffyduckOption: C
Sep 1, 2022

The Answer is C

recep38Option: D
Feb 23, 2024

it is very clear

090200fOption: C
Jul 15, 2024

C is the correct ans