github.com/hugorut/terraform@v1.1.3/website/docs/language/functions/tostring.mdx (about) 1 --- 2 page_title: tostring - Functions - Configuration Language 3 description: The tostring function converts a value to a string. 4 --- 5 6 # `tostring` Function 7 8 `tostring` converts its argument to a string value. 9 10 Explicit type conversions are rarely necessary in Terraform because it will 11 convert types automatically where required. Use the explicit type conversion 12 functions only to normalize types returned in module outputs. 13 14 Only the primitive types (string, number, and bool) and `null` can be converted to string. 15 All other values will produce an error. 16 17 ## Examples 18 19 ``` 20 > tostring("hello") 21 hello 22 > tostring(1) 23 1 24 > tostring(true) 25 true 26 > tostring(null) 27 null 28 > tostring([]) 29 Error: Invalid function argument 30 31 Invalid value for "v" parameter: cannot convert tuple to string. 32 ```