HashiCorp
TERRAFORM-ASSOCIATE-003 · Question #22
You have declared a variable called var.list which is a list of objects that all have an attribute id . Which options will produce a list of the IDs? Choose two correct answers.
Sign in or unlock TERRAFORM-ASSOCIATE-003 to reveal the answer and full explanation for question #22. The question stem and answer options stay visible for context.
Read, generate, and modify configuration
Question
You have declared a variable called var.list which is a list of objects that all have an attribute id . Which options will produce a list of the IDs? Choose two correct answers.
Options
- A[ var.list [ * ] , id ]
- B[ for o in var.list : o.Id ]
- Cvar.list[*].id
- D{ for o in var.llst : o => o.id }
Unlock TERRAFORM-ASSOCIATE-003 to see the answer
You've previewed enough free TERRAFORM-ASSOCIATE-003 questions. Unlock TERRAFORM-ASSOCIATE-003 for full answers, explanations, the timed quiz mode, progress tracking, and the master PDF. Question stem and options stay visible so you can still see what's on the exam.
Topics
#splat expression#for expression#list comprehension#complex types