nerdexam
HashiCorp

TA-002-P · Question #319

What is the result of the following terraform function call?

The correct answer is B. what? This question assesses knowledge of Terraform function evaluation, where a specific function call produces a particular string output.

Read, generate, and modify configuration

Question

What is the result of the following terraform function call?

Options

  • Ahello
  • Bwhat?
  • Cgoodbye

How the community answered

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

Why each option

This question assesses knowledge of Terraform function evaluation, where a specific function call produces a particular string output.

Ahello

This choice would be correct if the function call evaluated to "hello", such as accessing the first element of a list using index 0.

Bwhat?Correct

The Terraform function call implicitly referenced in the question, likely using a list indexing function such as `element` with `element(["hello", "what?", "goodbye"], 1)`, evaluates to the string "what?". This function selects the item at the specified index from the provided list.

Cgoodbye

This choice would be correct if the function call evaluated to "goodbye", such as accessing the third element of a list using index 2.

Concept tested: Terraform function evaluation

Source: https://developer.hashicorp.com/terraform/language/functions/element

Topics

#Terraform functions#String functions#Expression evaluation

Community Discussion

No community discussion yet for this question.

Full TA-002-P Practice