nerdexam
HashiCorp

TA-002-P · Question #397

You can reference a resource created with for_each using a Splat (*) expression.

The correct answer is B. False. Splat Expressions with Maps The splat expression patterns shown above apply only to lists, sets, and tuples. To get a similar result with a map or object value you must use for expressions. Resources that use the for_each argument will appear in expressions as a map of objects…

Read, generate, and modify configuration

Question

You can reference a resource created with for_each using a Splat (*) expression.

Options

  • ATrue
  • BFalse

How the community answered

(23 responses)
  • A
    4% (1)
  • B
    96% (22)

Explanation

Splat Expressions with Maps The splat expression patterns shown above apply only to lists, sets, and tuples. To get a similar result with a map or object value you must use for expressions. Resources that use the for_each argument will appear in expressions as a map of objects, so you can't use splat expressions with those resources.

Topics

#for_each#Splat expression#Resource referencing#Collection types

Community Discussion

No community discussion yet for this question.

Full TA-002-P Practice