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:
Chosen Answer:
This is a voting comment (?). You can switch to a simple comment. It is better to Upvote an existing comment if you don't have anything to add.
Submit