HashiCorp
TERRAFORM-ASSOCIATE-004 · Question #28
You can reference a resource created with for_each using a Splat ( *) expression.
The correct answer is B. False. You cannot reference a resource created with for_each using a splat (*) expression, as it will not work with resources that have non-numeric keys. You need to use a for expression instead to iterate over the resource instances.
Submitted by rohit_dlh· Apr 18, 2026Work with Terraform Configurations
Question
You can reference a resource created with for_each using a Splat ( *) expression.
Options
- ATrue
- BFalse
How the community answered
(47 responses)- A28% (13)
- B72% (34)
Explanation
You cannot reference a resource created with for_each using a splat (*) expression, as it will not work with resources that have non-numeric keys. You need to use a for expression instead to iterate over the resource instances.
Topics
#for_each#Splat expression#Resource referencing#Collection types
Community Discussion
No community discussion yet for this question.