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 11 Question 88 Discussion

Actual exam question for HashiCorp's VA-002-P exam
Question #: 88
Topic #: 11
[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:

Royal
3 months ago
Seriously, who comes up with these questions? I bet the developer was chuckling to themselves the whole time.
upvoted 0 times
...
Vallie
3 months ago
Trick question! The answer is C, but only if you've got a crystal ball to see the future.
upvoted 0 times
Gail
1 months ago
C) what?
upvoted 0 times
...
Elvera
1 months ago
B) hello
upvoted 0 times
...
Shelton
2 months ago
A) goodbye
upvoted 0 times
...
Asha
2 months ago
C) what?
upvoted 0 times
...
Yvonne
2 months ago
B) hello
upvoted 0 times
...
Tawna
2 months ago
A) goodbye
upvoted 0 times
...
Hermila
2 months ago
No, it's actually D
upvoted 0 times
...
Antione
3 months ago
I think the answer is C
upvoted 0 times
...
...
Dong
3 months ago
I remember that the result is 'what?' because the function returns the default value if the key is not found
upvoted 0 times
...
Reid
3 months ago
I'm not sure, but I think it's 'c'
upvoted 0 times
...
Lorean
3 months ago
Hmm, let me think... Ah, I got it! The answer is C, obviously. What else would it be?
upvoted 0 times
Paz
2 months ago
Oh, I see now. It must be D) c
upvoted 0 times
...
Marla
2 months ago
Actually, I believe it's C) what?
upvoted 0 times
...
Elise
3 months ago
No, I'm pretty sure it's B) hello
upvoted 0 times
...
Cletus
3 months ago
I think the answer is A) goodbye
upvoted 0 times
...
...
Aleshia
3 months ago
I believe the result is 'goodbye'
upvoted 0 times
...
Yolande
3 months ago
I think the result is 'what?'
upvoted 0 times
...
Ilona
3 months ago
Ah, the good ol' lookup function. Time to put my Terraform skills to the test!
upvoted 0 times
...
Werner
4 months ago
C'mon, this is so easy even my grandma could get it right. The answer is clearly C - what?
upvoted 0 times
Nohemi
3 months ago
C) what?
upvoted 0 times
...
Ivette
3 months ago
B) hello
upvoted 0 times
...
Rasheeda
3 months ago
A) goodbye
upvoted 0 times
...
...

Save Cancel