1. Docs
  2. Pulumi ESC
  3. Environment Definition Reference
  4. Built-in Functions
  5. fn::toBase64

fn::toBase64

    The fn::toBase64 built-in function encodes a binary value using Base64. If the input to fn::toBase64 is a secret, the encoded value is also a secret.

    Declaration

    fn::toBase64: value-to-encode
    

    Parameters

    PropertyTypeDescription
    value-to-encodebinaryThe value to encode.

    Returns

    The encoded data.

    Example

    Definition

    values:
      binary-data:
        fn::toBase64: hello, world!
    

    Evaluated result

    {
      "binary-data": "aGVsbG8sIHdvcmxkIQo="
    }
    
      PulumiUP May 6, 2025. Register Now.