Operators are used for arithmetic or logical operations.
a
and b
together.b
from a
.a
and b
.a
by b
.a
by b
. This operator is generally useful only when used with whole numbers.a
by -1.true
if a
and b
both have the same type and the same value, or false
otherwise.a == b
.true
if a
is less than b
, or false
otherwise.true
if a
is greater than b
, or false
otherwise.true
if a
is less than or equal to b
, or false
otherwise.true
if a
is greater than or equal to b
, or false
otherwise.true
if either a
or b
is true
, or false
if both are false
.true
if both a
and b
are true
, or false
if either one is false
.true
if a
is false
, or false
if a
is true
.A conditional expression uses the value of a Boolean expression to select one of two values. For example:
condition ? one_value : two_value
A for
expression can be used to traverse a set of collections and map one collection type to another. For example:
[for item in items : upper(item)]
An expanded expression is a concise expression similar to a for
expression. For example:
[for o in var.list : o.id]
is equivalent to
var.list[*].id
Terraform supports the use of some built-in functions when expressions are calculated. An expression to call a function is similar to an operator. For example:
upper("123")
Was this page helpful?