TA-002-P · Question #189
TA-002-P Question #189: Real Exam Question with Answer & Explanation
The correct answer is A: Remote State. Remote state stores the Terraform state file in a shared centralized backend so all team members reference the same source of truth, enabling consistent operations and state locking to prevent conflicts.
Question
When using Terraform in a team it is important for everyone to be working with the same state so that operations will be applied to the same remote objects. Which of the below option is a recommended solution for this?
Options
- ARemote State
- BModule
- CUse the cached state and treat this as the record of truth.
- DWorkspace
Explanation
Remote state stores the Terraform state file in a shared centralized backend so all team members reference the same source of truth, enabling consistent operations and state locking to prevent conflicts.
Common mistakes.
- B. Modules are reusable configuration abstractions and have no mechanism for sharing or synchronizing state data between team members.
- C. Using locally cached state in a team environment is dangerous because different developers may have stale or divergent copies, leading to unintended overwrites or missed infrastructure changes.
- D. Workspaces allow multiple isolated state instances within a single backend but do not themselves solve the problem of sharing a single consistent state among collaborators - remote state storage is still required.
Concept tested. Terraform remote state backend for team state sharing
Reference. https://developer.hashicorp.com/terraform/language/state/remote
Topics
Community Discussion
No community discussion yet for this question.