Skip to content

tostring does not behave as documented #30899

@cromega

Description

@cromega

The documentation says that:

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

However, quite clearly, tostring does not perform a type conversion for null values:

> tostring(null)
null

Terraform Version

Terraform v1.1.8
on linux_amd64

Expected Behavior

> tostring(null)
""

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions