Standard Library Operator Functions
and_bool
and_bool returns the binary AND of the left- and right-hand-side arguments.
Inputs
- Name
lhs- Required
- optional
- Type
- bool
- Description
A
booleanvalue.
- Name
rhs- Required
- optional
- Type
- bool
- Description
A
booleanvalue.
Output
- Name
value- Type
- bool
- Description
The result of a binary AND between the two arguments.
Example using and_bool
output "my_bool" {
value = false && true
}
// > my_bool: false
or_bool
or_bool returns the binary OR of the left- and right-hand-side arguments.
Inputs
- Name
lhs- Required
- optional
- Type
- bool
- Description
A
booleanvalue.
- Name
rhs- Required
- optional
- Type
- bool
- Description
A
booleanvalue.
Output
- Name
value- Type
- bool
- Description
The result of a binary OR between the two arguments.
Example using or_bool
output "my_bool" {
value = false || true
}
// > my_bool: true
div
div returns the integer division of the left-hand-side argument by the right-hand-side argument, rounding any remainder down to the nearest integer.
Inputs
- Name
lhs- Required
- optional
- Type
- integer
- Description
The
intdividend.
- Name
rhs- Required
- optional
- Type
- integer
- Description
The
intdivisor.
Output
- Name
value- Type
- integer
- Description
The result of dividing the dividend by the divisor.
Example using div
output "my_int" {
value = 11 / -3
}
// > my_int: -3
eq
eq returns true if the left- and right-hand-side arguments are equal and false if they are not.
Inputs
- Name
lhs- Required
- optional
- Type
- null | integer | float | integer | string | bool | addon() | array[null] | object
- Description
Any value.
- Name
rhs- Required
- optional
- Type
- null | integer | float | integer | string | bool | addon() | array[null] | object
- Description
Any value.
Output
- Name
value- Type
- bool
- Description
The result of an equality check between the two inputs.
Example using eq
output "is_eq" {
value = "arg" == "arg"
}
// > is_eq: true
gt
gt returns true if the left-hand-side argument is greater than the right-hand-side argument and false if it is not.
Inputs
- Name
lhs- Required
- optional
- Type
- null | integer | float | integer | string | bool
- Description
An
integer,float,string,booleanornullvalue.
- Name
rhs- Required
- optional
- Type
- null | integer | float | integer | string | bool
- Description
An
integer,float,string,booleanornullvalue.
Output
- Name
value- Type
- bool
- Description
The result of checking if the left-hand-side argument is greater than the right-hand-side argument
Example using gt
output "is_gt" {
value = 2 > 1
}
// > is_gt: true
gte
gte returns true if the left-hand-side argument is greater than or equal to the right-hand-side argument and false if it is not.
Inputs
- Name
lhs- Required
- optional
- Type
- null | integer | float | integer | string | bool
- Description
An
integer,float,string,booleanornullvalue.
- Name
rhs- Required
- optional
- Type
- null | integer | float | integer | string | bool
- Description
An
integer,float,string,booleanornullvalue.
Output
- Name
value- Type
- bool
- Description
The result of checking if the left-hand-side argument is greater than or equal to the right-hand-side argument
Example using gte
output "is_gte" {
value = 2 >= 2
}
// > is_gte: true
lt
lt returns true if the left-hand-side argument is less than the right-hand-side argument and false if it is not.
Inputs
- Name
lhs- Required
- optional
- Type
- null | integer | float | integer | string | bool
- Description
An
integer,float,string,booleanornullvalue.
- Name
rhs- Required
- optional
- Type
- null | integer | float | integer | string | bool
- Description
An
integer,float,string,booleanornullvalue.
Output
- Name
value- Type
- bool
- Description
The result of checking if the left-hand-side argument is less than the right-hand-side argument
Example using lt
output "is_lt" {
value = 2 < 1
}
// > is_lt: false
lte
lte returns true if the left-hand-side argument is less than or equal to the right-hand-side argument and false if it is not.
Inputs
- Name
lhs- Required
- optional
- Type
- null | integer | float | integer | string | bool
- Description
An
integer,float,string,booleanornullvalue.
- Name
rhs- Required
- optional
- Type
- null | integer | float | integer | string | bool
- Description
An
integer,float,string,booleanornullvalue.
Output
- Name
value- Type
- bool
- Description
The result of checking if the left-hand-side argument is less than or equal to the right-hand-side argument
Example using lte
output "is_lte" {
value = 2 <= 2
}
// > is_lte: true
neq
enq returns true if the left- and right-hand-side arguments are not equal and false otherwise.
Inputs
- Name
lhs- Required
- optional
- Type
- null | integer | float | integer | string | bool
- Description
An
integer,float,string,booleanornullvalue.
- Name
rhs- Required
- optional
- Type
- null | integer | float | integer | string | bool
- Description
An
integer,float,string,booleanornullvalue.
Output
- Name
value- Type
- bool
- Description
The result of a negated equality check between the two inputs.
Example using neq
output "is_neq" {
value = "arg" != "arg"
}
// > is_neq: false
minus
minus returns the result of subtracting the right-hand-side integer argument from the left-hand-side integer argument.
Inputs
- Name
lhs- Required
- optional
- Type
- integer
- Description
The
integerminuend.
- Name
rhs- Required
- optional
- Type
- integer
- Description
The
integersubtrahend.
Output
- Name
value- Type
- integer
- Description
The result of the subtraction operation.
Example using minus
output "my_integer" {
value = 10 - 6
}
// > my_integer: 4
modulo
modulo returns the remainder of dividing the left-hand-side integer argument by the right-hand-side integer argument.
Inputs
- Name
lhs- Required
- optional
- Type
- integer
- Description
The
integerdividend.
- Name
rhs- Required
- optional
- Type
- integer
- Description
The
integerdivisor.
Output
- Name
value- Type
- integer
- Description
The remainder of the division operation.
Example using modulo
output "my_mod" {
value = 10 % 3
}
// > my_mod: 1
multiply
multiply returns the product of the left-hand-side integer argument and the right-hand-side integer argument.
Inputs
- Name
lhs- Required
- required
- Type
- integer
- Description
The first
integeroperand.
- Name
rhs- Required
- required
- Type
- integer
- Description
The second
integeroperand.
Output
- Name
value- Type
- integer
- Description
The result of the multiplication operation.
Example using multiply
output "my_product" {
value = 10 * 5
}
// > my_product: 50
add
add returns the sum of the left-hand-side integer argument and the right-hand-side integer argument.
Inputs
- Name
lhs- Required
- optional
- Type
- integer
- Description
The first
integeroperand.
- Name
rhs- Required
- optional
- Type
- integer
- Description
The second
integeroperand.
Output
- Name
value- Type
- integer
- Description
The result of the addition operation.
Example using add
output "my_sum" {
value = 10 + 5
}
// > my_sum: 15
neg_integer
Returns the negation of the given integer.
Inputs
- Name
value- Required
- optional
- Type
- integer
- Description
An integer value.
Output
- Name
value- Type
- integer
- Description
The negated integer value.
Example using neg_integer
// Coming soon
not_bool
Returns the logical negation of the given boolean value.
Inputs
- Name
value- Required
- optional
- Type
- bool
- Description
A boolean value.
Output
- Name
value- Type
- bool
- Description
The logical negation of the input boolean value.
Example using not_bool
// Coming soon