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
Curtis
4 days ago
I feel confident about C. It’s efficient and saves time.
upvoted 0 times
...
Beatriz
9 days ago
D could happen too, but I believe C is the right answer.
upvoted 0 times
...
Carmen
14 days ago
But what if it tears down everything? A seems risky.
upvoted 0 times
...
Ulysses
19 days ago
I agree, C makes sense. It only focuses on what's missing.
upvoted 0 times
...
Luis
24 days ago
I think it's C. Terraform will just rebuild the deleted instances.
upvoted 0 times
...
Anjelica
29 days ago
Yup, C is the right answer! Terraform is smart like that.
upvoted 0 times
...
Gearldine
1 month ago
Wait, are you sure? I thought it might error out first.
upvoted 0 times
...
Doretha
1 month ago
Definitely option C, that's how it works.
upvoted 0 times
...
Precious
1 month ago
I thought it would tear everything down!
upvoted 0 times
...
Arlene
2 months ago
Terraform will just rebuild the deleted instances.
upvoted 0 times
...
Geraldo
2 months ago
Nah, it definitely just rebuilds what's gone.
upvoted 0 times
...
Bonita
2 months ago
I think it stops and throws an error if instances are missing.
upvoted 0 times
...
Octavio
2 months ago
Wait, are you sure it won't tear down everything?
upvoted 0 times
...
Mireya
2 months ago
Totally agree, it's designed to manage state efficiently!
upvoted 0 times
...
Van
3 months ago
Terraform will only rebuild the instances that were deleted.
upvoted 0 times
...
Lemuel
3 months 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
3 months 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
3 months 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
3 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