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.
Question
What is the result of the following terraform function call?
Options
- Ahello
- Bwhat?
- Cgoodbye
How the community answered
(23 responses)- B96% (22)
- C4% (1)
Why each option
This question assesses knowledge of Terraform function evaluation, where a specific function call produces a particular string output.
This choice would be correct if the function call evaluated to "hello", such as accessing the first element of a list using index 0.
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.
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
Community Discussion
No community discussion yet for this question.