Skip to main content
Errand’s expression syntax is defined by HCL. Expressions appear in computed block expression attributes, task condition and working_dir values, and inside ${} interpolations in command strings.

Operators

Arithmetic

Comparison

Logical

Precedence

Operators evaluate in this order, highest to lowest: Use parentheses when order might be ambiguous:

Conditional

The ternary operator selects between two values based on a condition:
Both branches must produce a compatible type.

Index and attribute access

Access list elements by zero-based index:
Access map and object values by key or dot notation:
Dot notation and bracket notation are equivalent for string keys. Accessing an out-of-bounds index or a missing key is an error at evaluation time.

Function calls

Call a function by name with arguments in parentheses. Functions can be nested:
All built-in functions are available in every expression context. See the functions reference.

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).