Question 890
At Clearwater Retail Infrastructure, an authorized infrastructure engineering team manages a Terraform 1.12 and HCP Terraform environment. The team encounters the following situation: a developer checks the state JSON into Git to let a colleague review resources. Choose the technically best Terraform Associate 004 practice response to this particular infrastructure case. What mechanism explains why the original approach fails?
Explanation
Correct Answer
State is runtime inventory and may expose secrets whereas the source repository is for desired configuration. That mechanism distinguishes local backend retained temporary file in the Clearwater Retail Infrastructure case. The corresponding appropriate correction is: Commit HCL configuration and use an approved protected state backend instead. The measurable acceptance test is: The Git repository contains no state snapshots and Terraform still plans correctly.
Incorrect Answers
“Losing local state removes Terraform's stored association between addresses and remote objects” reflects the mechanism: Losing local state removes Terraform's stored association between addresses and remote objects. The actual reported symptoms are better explained by: State is runtime inventory and may expose secrets whereas the source repository is for desired configuration.
The offered principle describes: Backend read capability alone does not prove locking and state write access are available. The situation in this question instead depends on: State is runtime inventory and may expose secrets whereas the source repository is for desired configuration. These are different technical conditions.
“Each repeated Terraform resource instance has its own address and state mapping” reflects the mechanism: Each repeated Terraform resource instance has its own address and state mapping. The actual reported symptoms are better explained by: State is runtime inventory and may expose secrets whereas the source repository is for desired configuration.