Question 650
At Umberwick Health Research, an authorized infrastructure engineering team manages a Terraform 1.12 and HCP Terraform environment. The team encounters the following situation: an exposed environment variable accepts the value prodction and creates resources with a misspelled prefix. 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
Custom variable conditions fail early when a caller supplies disallowed values. That mechanism distinguishes input variable validation condition in the Umberwick Health Research case. The corresponding appropriate correction is: Add a variable validation block restricting permitted environment values. The measurable acceptance test is: The misspelled fixture is rejected with a clear custom message.
Incorrect Answers
“Terraform check assertions report warnings rather than acting like resource lifecycle hard failures” reflects the mechanism: Terraform check assertions report warnings rather than acting like resource lifecycle hard failures. The actual reported symptoms are better explained by: Custom variable conditions fail early when a caller supplies disallowed values.
The offered principle describes: Variable values are separate from the reusable desired-state logic. The situation in this question instead depends on: Custom variable conditions fail early when a caller supplies disallowed values. These are different technical conditions.
This alternative is valid when provider configurations are passed from callers and an alias is not implicitly created in child modules. The facts here establish a different controlling reason: Custom variable conditions fail early when a caller supplies disallowed values.