You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
packer/website/content/docs/templates/hcl_templates/functions/collection/values.mdx

29 lines
709 B

---
page_title: values - Functions - Configuration Language
description: The values function returns a list of the element values in a given map.
---
# `values` Function
`values` takes a map and returns a list containing the values of the elements
in that map.
The values are returned in lexicographical order by their corresponding _keys_,
so the values will be returned in the same order as their keys would be
returned from [`keys`](/docs/templates/hcl_templates/functions/collection/keys).
## Examples
```shell-session
> values({a=3, c=2, d=1})
[
3,
2,
1,
]
```
## Related Functions
- [`keys`](/docs/templates/hcl_templates/functions/collection/keys) returns a list of the _keys_ from a map.