Question 500
An implementation review finds that a staging-environment maintainer must convert nested lists of subnet IDs into one-level sequence. Which solution is defensible?
Explanation
Correct Answer
Flatten recursively removes directly nested list structure. This meets the stated requirement to convert nested lists of subnet IDs into one-level sequence.
Incorrect Answers
coalesce function is intended to select the first string value that is neither null nor empty in a preference list; coalesce chooses the first non-null nonempty string. That is not the specific requirement to convert nested lists of subnet IDs into one-level sequence.
merge function is intended to combine default and environment-specific maps with later keys overriding earlier entries; merge returns a combined map with latter values winning for duplicate keys. That is not the specific requirement to convert nested lists of subnet IDs into one-level sequence.
try function is intended to select the first expression that can be evaluated without a dynamic error; try catches dynamic expression errors and returns the first successful result. That is not the specific requirement to convert nested lists of subnet IDs into one-level sequence.






HashiCorp Certified: Terraform Associate (004) (Terraform Associate 004) Practice Tests