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

12 comments
Sign in to comment
legendary7
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

adouban
Dec 12, 2022

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

BurakkoOption: C
Sep 1, 2022

the correct answer is C.

amanpOption: C
Sep 5, 2022

Answer is C.

Power123
Mar 31, 2023

C is correct

Ni33Option: C
May 9, 2023

C is the correct answer !

duffyduck
Sep 1, 2022

The Answer is C

recep38Option: D
Feb 23, 2024

it is very clear

tamng
Aug 14, 2024

stupid

090200f
Jul 15, 2024

C is the correct ans

MatttOption: C
Sep 16, 2024

C is correct

chessmaster5000Option: C
Mar 17, 2025

C is the answer. Terraform will detect the missing instances and create them to match the tf config file.