A senior admin accidentally deleted some of your cloud instances. What will Terraform do when you run terraform apply?
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
Currently there are no comments in this discussion, be the first to comment!