Question 370
A Terraform associate evaluates: An operator wants to inspect how a Terraform function handles an input before running plan. Select TWO complementary responses: the appropriate action AND direct evidence it worked.
Explanation
Correct Answers
The observed situation is: An operator wants to inspect how a Terraform function handles an input before running plan. The acceptance evidence is: terraform console evaluates the expression to the expected value for representative inputs. It verifies the corrective approach (Use Terraform expressions and built-in functions such as merge, lookup, length and format to compute values reproducibly from configuration inputs.) and controls the risk: Manually duplicating derived labels and tags across resources invites inconsistency and errors. Checking an unrelated Terraform setting would not prove the stated requirement was met.
The case says: An operator wants to inspect how a Terraform function handles an input before running plan. The directly relevant Terraform response is: Use Terraform expressions and built-in functions such as merge, lookup, length and format to compute values reproducibly from configuration inputs. This addresses the related failure mode: Manually duplicating derived labels and tags across resources invites inconsistency and errors. Validate the result by checking: terraform console evaluates the expression to the expected value for representative inputs. The selection matches this objective, rather than a different Terraform administration task.
Incorrect Answers
Using a set where stable indices are required can make addressing and ordering assumptions invalid. That is the exact risk associated with Terraform list set and map collections (official objective 4d), not the required Terraform expressions and built-in functions outcome.
An authorized workflow can consume the output while casual CLI display is redacted and backend access remains restricted. This addresses Outputs and sensitive display control (official objective 4c). The separate hazard is that a sensitive output designation hides normal CLI disclosure but does not guarantee the underlying state contains no secret. It does not by itself satisfy the case-specific requirement for Terraform expressions and built-in functions.
Use for_each keyed by stable resource identifiers for collections whose entries change independently and count for genuinely index-oriented repetition. This does not provide the required Terraform expressions and built-in functions action-and-evidence pair.