Files
opentf/website/docs/configuration/functions/tostring.html.md
Nick Fagerlund 596e529602 website: Adopt a ton of pages into the "language" layout
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.
2020-10-26 18:19:26 -07:00

1013 B

layout, page_title, sidebar_current, description
layout page_title sidebar_current description
language tostring - Functions - Configuration Language docs-funcs-conversion-tostring The tostring function converts a value to a string.

tostring Function

-> Note: This page is about Terraform 0.12 and later. For Terraform 0.11 and earlier, see 0.11 Configuration Language: Interpolation Syntax.

tostring converts its argument to a string 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.

Only the primitive types (string, number, and bool) can be converted to string. All other values will produce an error.

Examples

> tostring("hello")
hello
> tostring(1)
1
> tostring(true)
true
> tostring([])
Error: Invalid function argument

Invalid value for "v" parameter: cannot convert tuple to string.