All Products
Search
Document Center

Resource Orchestration Service:Fn::Any

Last Updated:Feb 19, 2025

The built-in function Fn::Any checks the values in an array. If one of the values is evaluated to true, true is returned. If none of the values are evaluated to true, false is returned.

Declaration

  • JSON

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

    • Syntax for the full function name:

      Fn::Any: value_1, value_2, ... 
    • Syntax for the short form:

      !Any [value_1, value_2, ... ]

Parameters

value: Required. This parameter specifies the value in the array. All data types are supported. For example, you can set the value parameter to true, false, 1, and 0. 1 and 0 are used as logical values.

Return value

true or false.

Examples

  • Example 1

    Fn::Any: true, true

    In this example, true is returned.

  • Example 2

    Fn::Any: true, false

    In this example, true is returned.

  • Example 3

    Fn::Any: false, false

    In this example, false is returned.

  • Example 4

    Fn::Any: 1, 1

    In this example, true is returned.

  • Example 5

    Fn::Any: 0, 0

    In this example, false is returned.