Question 860
At Brightmarsh Retail Infrastructure, an authorized infrastructure engineering team manages a Terraform 1.12 and HCP Terraform environment. The team encounters the following situation: a module sourced from a moving Git branch unexpectedly changes between CI runs. Choose the technically best Terraform Associate 004 practice response to this particular infrastructure case. Which operational control addresses the risk long term?
Explanation
Correct Answer
Avoid unpinned mutable branches in production module sources. This control addresses module version in vcs repository because git branch names can move without modifications to the caller configuration. The original implementation remedy remains: Pin the Git source ref to a trusted immutable commit or reviewed release tag.
Incorrect Answers
That review protects the control associated with: Terraform initialization caches installed modules and may not replace them without an upgrade. It does not directly prevent the stated recurrence, which concerns: Git branch names can move without modifications to the caller configuration. The appropriate guardrail is “Avoid unpinned mutable branches in production module sources”.
This safeguard is for the dependency described by: Modules are reusable building blocks whose boundaries should reflect coherent responsibilities. The continuing risk here is determined by: Git branch names can move without modifications to the caller configuration. The targeted safeguard is “Avoid unpinned mutable branches in production module sources”.
“Test each environment branch of dynamic infrastructure expressions” addresses a different recurring failure: Terraform expressions can select a configuration value from a condition. For the condition in this question, maintain “Avoid unpinned mutable branches in production module sources” because git branch names can move without modifications to the caller configuration.