Resource Orchestration Service (ROS) provides various built-in functions to help you manage stacks. You can use built-in functions in the Resources and Outputs sections. This topic describes the built-in functions that are supported by ROS.
Considerations
If you use YAML to define a function in the short syntax form and specify the parameter value of the function by using another function, you must define at least one of the functions in the full syntax form. Otherwise, the functions are invalid.
Functions in the following syntax form are invalid:
!Base64Encode !Sub string !Base64Encode !Ref logical_IDFunctions in the following syntax forms are valid:
!Base64Encode "Fn::Sub": string Fn::Base64Encode: !Sub string
Supported functions
Function | Description |
Returns the Base64-encoded format of a string. | |
Returns a string decoded from a Base64-encoded string. | |
Returns the string form of a number. | |
Adjusts the indentation format of a string. | |
Returns the value that corresponds to keys in a two-level mapping declared in the Mappings section. | |
Returns the property value of a resource from a template. | |
Combines a set of strings into a single string that is separated by a delimiter. | |
Substitutes variables in a string with values that you specify. | |
Returns data elements from a list or a dictionary based on an index. | |
References the value of a parameter or resource. | |
Returns a list of zones that belong to a region. | |
Replaces a substring in a string with another substring. | |
Splits a string into multiple values by using a delimiter. | |
Compares two values to check whether they are equal. If the two values are equal, true is returned. If the two values are not equal, false is returned. | |
Represents the AND operator and must contain at least two conditions. If all the specified conditions are evaluated to true, true is returned. If a condition is evaluated to false, false is returned. | |
Represents the OR operator and must contain at least two conditions. If a condition is evaluated to true, true is returned. If all the specified conditions are evaluated to false, false is returned. | |
Represents the NOT operator. If a condition is evaluated to false, true is returned. If a condition is evaluated to true, false is returned. | |
Queries the index of an element in a list. | |
Returns one of two possible values. The function returns one value if a specified condition is evaluated to true, and returns the other value if not. The property values in the Resources and Outputs sections of templates support the built-in function Fn::If. You can use the pseudo parameter | |
Returns the number of elements in an object. | |
Merges multiple lists into one list. | |
Resolves a JSON string and queries the value of a key from the first layer. | |
Merges multiple mappings into a new mapping list. | |
Returns the average value of a set of numbers. | |
Returns values from a list of maps. | |
Calculates the sum of parameters. | |
Returns the calculation result of an expression of the String type. | |
Returns the largest number from a list of numbers. | |
Returns the smallest number from a list of numbers. | |
Queries the output of a stack. | |
Supports jq features. For more information about jq features, see jq Manual (development version). | |
Returns a formatted value of the current time. | |
Returns the default ID of an Alibaba Cloud Marketplace image based on the product code of the image. | |
Checks the values in an array. If one of the values is evaluated to true, true is returned. If none of the values is evaluated to true, false is returned. | |
Returns true if a specified value matches at least one member in a list, and returns false if not. | |
Returns true if each member in a list matches at least one member in another list, and returns false if not. | |
Checks whether a value of the String type matches the condition in a regular expression. If the value matches the condition, true is returned. Otherwise, false is returned. |