Function Syntax
The functions in Terraform follow this common syntax:
FUNCTION_NAME(argument-1, argument-2, . . . . argument-n)
FUNCTION_NAME
is the name of the function to be called, and the number of arguments it takes will vary from 1
to n
based on the function.
Some of the functions have a definitive set of arguments that they can accept, and a few will accept any variable number of inputs. For example, the endswith()
string function will accept only two arguments and return either true
or false
. The first argument is the string to check and the second is the suffix string.
But if you take the max()
function, which gives the maximum number in the given list of input numbers, you can pass any number of input values and the result will be a single number.