mirror of
https://github.com/opentffoundation/opentf.git
synced 2026-02-14 19:00:37 -05:00
As of this commit, that layout doesn't exist yet, but I'm isolating the one-line changes to their own commit to try and keep your eyes from glazing over.
976 B
976 B
layout, page_title, sidebar_current, description
| layout | page_title | sidebar_current | description |
|---|---|---|---|
| language | tomap - Functions - Configuration Language | docs-funcs-conversion-tomap | The tomap function converts a value to a map. |
tomap Function
-> Note: This page is about Terraform 0.12 and later. For Terraform 0.11 and earlier, see 0.11 Configuration Language: Interpolation Syntax.
tomap converts its argument to a map value.
Explicit type conversions are rarely necessary in Terraform because it will convert types automatically where required. Use the explicit type conversion functions only to normalize types returned in module outputs.
Examples
> tomap({"a" = 1, "b" = 2})
{
"a" = 1
"b" = 2
}
Since Terraform's concept of a map requires all of the elements to be of the same type, mixed-typed elements will be converted to the most general type:
> tomap({"a" = "foo", "b" = true})
{
"a" = "foo"
"b" = "true"
}