Which TWO collection types can be passed to a resource's for_each meta-argument? (Choose two.)
- A.
A list of strings, directly
- B.
A map
- C.
A set of strings
- D.
A number
- E.
A single string
Show answer and explanation
Answer: B and C
for_each accepts a map or a set of strings. To use a list you must convert it, for example with toset().
- A list of strings, directly: A list must be converted to a set first.
- A number: Numbers are used with
count. - A single string:
for_eachneeds a collection.