1. Docs
  2. Secrets & Configuration
  3. Environments
  4. Environment Definition Syntax
  5. Built-in Functions
  6. fn::split

fn::split

    The fn::split built-in function splits a string into a list of strings using a given delimiter. If any input to fn::split is a secret, the result is also a secret.

    Declaration

    fn::split: [ delimiter, value ]
    

    Parameters

    PropertyTypeDescription
    delimiterstringThe delimiter to use when splitting the string
    valuestringThe string to split

    Returns

    A list of strings created by splitting value by delimiter.

    Example

    Definition

    values:
      joined-string: "one, two, three"
      split:
        fn::split: [ ", ", ${joined-string} ]
    

    Evaluated result

    {
      "joined-string": "one, two, three",
      "split": [
        "one",
        "two",
        "three"
      ]
    }
    
      Neo just got smarter about infrastructure policy automation