TA-002-P · Question #418
You have modified your local Terraform configuration and ran terraform plan to review the changes. Simultaneously, your teammate manually modified the infrastructure component you are working on…
The correct answer is B. False. A terraform plan snapshot reflects infrastructure state at the moment it was generated; manual changes made after that snapshot are not reflected in a subsequent apply.
Question
You have modified your local Terraform configuration and ran terraform plan to review the changes. Simultaneously, your teammate manually modified the infrastructure component you are working on. Since you already ran terraform plan locally, the execution plan for terraform apply will be the same.
Options
- ATrue
- BFalse
How the community answered
(34 responses)- A6% (2)
- B94% (32)
Why each option
A terraform plan snapshot reflects infrastructure state at the moment it was generated; manual changes made after that snapshot are not reflected in a subsequent apply.
True is incorrect because terraform plan output is a point-in-time snapshot; any out-of-band change to infrastructure invalidates it, and apply will recalculate based on real current state.
When terraform apply runs, it performs a fresh refresh of the current infrastructure state before executing. If a teammate manually changed a resource after your terraform plan, the apply phase will detect the new actual state and recalculate the diff, meaning the execution plan at apply time differs from the one generated by your earlier terraform plan.
Concept tested: Terraform plan staleness and apply refresh behavior
Source: https://developer.hashicorp.com/terraform/cli/commands/apply
Topics
Community Discussion
No community discussion yet for this question.