All Products
Search
Document Center

Resource Orchestration Service:Fn::Contains

Last Updated:Jun 17, 2026

Fn::Contains returns true if a specified value matches at least one member in a list, and false otherwise.

Declaration

  • JSON

    {
      "Fn::Contains": [
        [
          value_1,
          value_2,
          ...
        ],
        value
      ]
    }
  • YAML

    • Syntax for the full function name:

      Fn::Contains:
        - - value_1
          - value_2
          - ...
        - value
    • Syntax for the short form:

      !Contains [[value_1, value_2, ...], value]

Parameters

  • value_1, value_2, ...: Required. A list of members.

  • value: Required. The value to compare against the members in the list.

Return value

true or false.

Examples

  • !Contains
      - - 1
        - 2
        - 3
      - 3

    In this example, true is returned.

  • Fn::Contains:
      - - 1
        - 2
        - 3
      - 4

    In this example, false is returned.