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

fn::fromJSON

    The fn::fromJSON built-in function decodes a value from its JSON representation. This can be used to expand JSON values that are stored as scalar strings into complex values. If the input to fn::fromJSON is a secret, all of the decoded values are also secrets.

    Declaration

    fn::fromJSON: value-to-decode
    

    Parameters

    PropertyTypeDescription
    value-to-decodestringThe JSON value to decode.

    Returns

    The decoded value.

    Example

    Definition

    values:
      json-object:
        fn::fromJSON: "{\"hello\": \"world\"}"
    

    Evaluated result

    {
      "json-object": {
        "hello": "world"
      }
    }
    
      PulumiUP May 6, 2025. Register Now.