Question 410
A developer-platform lead has a concrete infrastructure task: create one managed instance for every named environment entry. What is the correct tool or language feature?
Explanation
Correct Answer
For_each indexes instances by keys rather than ordinal count. This meets the stated requirement to create one managed instance for every named environment entry.
Incorrect Answers
Splat expression for resource collection is intended to gather IDs of every counted instance into one list-like result; splat syntax selects the same field from a collection of objects. That is not the specific requirement to create one managed instance for every named environment entry.
for expression constructing a list is intended to transform each app name into its normalized prefixed label; for expressions transform collections using an expression for each item. That is not the specific requirement to create one managed instance for every named environment entry.
for expression constructing a map is intended to derive a key-to-resource-ID lookup from a group of objects; curly-brace for expressions produce key/value maps. That is not the specific requirement to create one managed instance for every named environment entry.






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