Skip to main content
  1. Docs
  2. Secrets & Configuration
  3. Concepts
  4. Built-in Functions
  5. fn::toString

fn::toString

    The fn::toString built-in function encodes a value as its string representation. This can be used to encode values for use in positions that only accept strings. If any input to fn::toString is a secret, the encoded values is also a secret.

    • Boolean values are encoded as true or false
    • Number values are encoded as the decimal representation of their whole and fractional parts
    • Strings are encoded verbatim
    • Binary data is encoded as its Base64-encoded representation
    • List values are encoded as a comma-separated list of the string representations of their entries
    • Mapping values are encoded as a comma-separated list of key=value pairs, where key and value are the string representations of each of the mapping’s key-value pairs

    Declaration

    fn::toString: value-to-encode
    

    Parameters

    PropertyTypeDescription
    value-to-encodeanyThe value to encode as a string.

    Returns

    The string representation of the value.