github.com/hugorut/terraform@v1.1.3/website/docs/language/functions/map.mdx (about) 1 --- 2 page_title: map - Functions - Configuration Language 3 description: The map function constructs a map from some given elements. 4 --- 5 6 # `map` Function 7 8 The `map` function is no longer available. Prior to Terraform v0.12 it was 9 the only available syntax for writing a literal map inside an expression, 10 but Terraform v0.12 introduced a new first-class syntax. 11 12 To update an expression like `map("a", "b", "c", "d")`, write the following instead: 13 14 ``` 15 tomap({ 16 a = "b" 17 c = "d" 18 }) 19 ``` 20 21 The `{ ... }` braces construct an object value, and then the `tomap` function 22 then converts it to a map. For more information on the value types in the 23 Terraform language, see [Type Constraints](/language/expressions/types). 24 25 ## Related Functions 26 27 * [`tomap`](/language/functions/tomap) converts an object value to a map. 28 * [`zipmap`](/language/functions/zipmap) constructs a map dynamically, by taking keys from 29 one list and values from another list.