Files
opentf/website/docs/configuration/functions/lookup.html.md
Martin Atkins 1360948a41 website: document the functions "keys", "lookup", and "values"
I missed these on the first pass because in the legacy function table they
are, for some reason, added in a different place than the others.
2018-10-16 18:49:20 -07:00

834 B

layout, page_title, sidebar_current, description
layout page_title sidebar_current description
functions lookup function docs-funcs-collection-lookup The lookup function retrieves an element value from a map given its key.

lookup Function

lookup retrieves the value of a single element from a map, given its key. If the given key does not exist, a the given default value is returned instead.

lookup(map, key, default)

-> For historical reasons, the default parameter is actually optional. However, omitting default is deprecated since v0.7 because that would then be equivalent to the native index syntax, map[key].

Examples

> lookup({a="ay", b="bee"}, "a", "what?")
ay
> lookup({a="ay", b="bee"}, "c", "what?")
what?
  • element retrieves a value from a list given its index.