TERRAFORM-ASSOCIATE-004 · Question #193
When do you need to explicitly execute Terraform in refresh-only mode?
The correct answer is C. Before every terraform import.. Running Terraform in refresh-only mode before terraform import ensures the existing state file accurately reflects real-world infrastructure before you add new resource entries to it. Without this, if the state is stale, importing a resource could create conflicts or produce an i
Question
Options
- ABefore every terraform plan.
- BBefore every terraform apply.
- CBefore every terraform import.
- DNone of the above.
How the community answered
(51 responses)- A2% (1)
- B6% (3)
- C82% (42)
- D10% (5)
Explanation
Running Terraform in refresh-only mode before terraform import ensures the existing state file accurately reflects real-world infrastructure before you add new resource entries to it. Without this, if the state is stale, importing a resource could create conflicts or produce an inaccurate post-import state. terraform plan and terraform apply already perform a refresh internally by default, so explicit refresh-only mode is not required before them.
Topics
Community Discussion
No community discussion yet for this question.