ExamGecko
Question list
Search
Search

Question 17 - Terraform Associate 003 discussion

Report
Export

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.

A.
[ var.list [ * ] , id ]
Answers
A.
[ var.list [ * ] , id ]
B.
[ for o in var.list : o.Id ]
Answers
B.
[ for o in var.list : o.Id ]
C.
var.list[*].id
Answers
C.
var.list[*].id
D.
{ for o in var.llst : o => o.id }
Answers
D.
{ for o in var.llst : o => o.id }
Suggested answer: B, C

Explanation:

These are two ways to produce a list of the IDs from a list of objects that have an attributeid, using either a for expression or a splat expression syntax.

asked 18/09/2024
Steven Cantu
39 questions
User
Your answer:
0 comments
Sorted by

Leave a comment first