Deal of The Day! Hurry Up, Grab the Special Discount - Save 25% - Ends In 00:00:00 Coupon code: SAVE25
Welcome to Pass4Success

- Free Preparation Discussions

HashiCorp Terraform-Associate-004 Exam - Topic 3 Question 13 Discussion

A senior admin accidentally deleted some of your cloud instances. What will Terraform do when you run terraform apply?
C) Rebuild only the instances that were deleted.
A) Tear down the entire workspace's infrastructure and rebuild it.
B) Build a completely brand new set of infrastructure.
D) Stop and generate an error message about the missing instances.

HashiCorp Terraform-Associate-004 Exam - Topic 3 Question 13 Discussion

Actual exam question for HashiCorp's Terraform-Associate-004 exam
Question #: 13
Topic #: 3
[All Terraform-Associate-004 Questions]

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

Show Suggested Answer Hide Answer
Suggested Answer: C

Terraform detects infrastructure drift by comparing thestate filewith the actual infrastructure.

When an instance ismanually deleted, Terraformsees it as missingand marks it for recreation.

Running terraform apply willonly recreate the missing instanceswhile leaving the rest of the infrastructure unchanged.

Explanation of incorrect answers:

A (Tear down everything and rebuild)-- Incorrect. Terraform does not destroy existing infrastructure unless explicitly told to.

B (Build a completely new set of infrastructure)-- Incorrect. Terraform does not create duplicates unless configuration changes.

D (Stop and error out)-- Incorrect. Terraform does not fail; itrebuilds missing resourcesautomatically.

Official Terraform Documentation Reference:

Handling Infrastructure Drift


Contribute your Thoughts:

0/2000 characters
Arlene
4 days ago
Terraform will just rebuild the deleted instances.
upvoted 0 times
...
Geraldo
9 days ago
Nah, it definitely just rebuilds what's gone.
upvoted 0 times
...
Bonita
14 days ago
I think it stops and throws an error if instances are missing.
upvoted 0 times
...
Octavio
19 days ago
Wait, are you sure it won't tear down everything?
upvoted 0 times
...
Mireya
24 days ago
Totally agree, it's designed to manage state efficiently!
upvoted 0 times
...
Van
29 days ago
Terraform will only rebuild the instances that were deleted.
upvoted 0 times
...
Lemuel
1 month ago
I’m a bit confused. I thought it might tear everything down if it detects missing resources, but that seems extreme. Maybe it just stops with an error?
upvoted 0 times
...
Carmen
1 month ago
I practiced a similar question, and I believe Terraform is smart enough to only recreate what's missing, so I would go with C as well.
upvoted 0 times
...
Berry
1 month ago
I’m not entirely sure, but I remember something about Terraform managing state files. Could it be that it stops and throws an error instead?
upvoted 0 times
...
Audry
2 months ago
I think Terraform will just rebuild the instances that were deleted, so I’m leaning towards option C.
upvoted 0 times
...

Save Cancel