Deal of The Day! Hurry Up, Grab the Special Discount - Save 25% - Ends In 00:00:00 Coupon code: SAVE25
Welcome to Pass4Success

- Free Preparation Discussions

HashiCorp Exam VA-002-P Topic 1 Question 83 Discussion

Actual exam question for HashiCorp's VA-002-P exam
Question #: 83
Topic #: 1
[All VA-002-P Questions]

What is the result of the following terraform function call?

lookup({a="hello", b="goodbye"}, "c", "what?")

Show Suggested Answer Hide Answer
Suggested Answer: C

lookup retrieves the value of a single element from a map, given its key. If the given key does not exist, the given default value is returned instead. In this case, the function call is searching for the key 'c'. But since there is no key 'c', the default vault 'what?' is returned.

https://www.terraform.io/docs/configuration/functions/lookup.html


Contribute your Thoughts:

Letha
1 years ago
Alright, let's go with C) what?. Confident about it.
upvoted 0 times
...
Merissa
1 years ago
Agree. It should return the default 'what?'.
upvoted 0 times
...
Scarlet
1 years ago
Makes sense. 'c' isn't a key in the map.
upvoted 0 times
...
Leonida
1 years ago
I believe the answer is C) what?.
upvoted 0 times
...
Letha
1 years ago
Yeah, I think it's testing default values.
upvoted 0 times
...
Scarlet
1 years ago
The terraform function call question seems tricky.
upvoted 0 times
...

Save Cancel