You can use terraform functions keys() and values() to get all the keys and values from a map in the form of a list.
Syntax: keys(map), values(map)
Example:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
## Open terraform console terraform console ## Get all keys from a map keys({a=1, c=2, d=3}) ## Returns ## [ ## "a", ## "c", ## "d", ## ] ## Get all values from a map values({a=1, c=2, d=3}) ## Returns ## [ ## 1, ## 2, ## 3, ## ] |