computed block expression attributes, task condition and working_dir values, and inside ${} interpolations in command strings.
Operators
Arithmetic
| Operator | Operation |
|---|---|
+ | Addition |
- | Subtraction |
* | Multiplication |
/ | Division |
% | Remainder |
Comparison
| Operator | Operation |
|---|---|
== | Equal |
!= | Not equal |
< | Less than |
<= | Less than or equal |
> | Greater than |
>= | Greater than or equal |
Logical
| Operator | Operation |
|---|---|
&& | And |
|| | Or |
! | Not |
Precedence
Operators evaluate in this order, highest to lowest:| Priority | Operators |
|---|---|
| Highest | !, - (unary) |
*, /, % | |
+, - | |
>, >=, <, <= | |
==, != | |
&& | |
| Lowest | || |
Conditional
The ternary operator selects between two values based on a condition:Index and attribute access
Access list elements by zero-based index:Function calls
Call a function by name with arguments in parentheses. Functions can be nested:HCL expression language
Errand uses a subset of HCL’s expression language. For expressions, splat expressions ([*]), and template directives (%{if}, %{for}) are not supported (yet).