Add link to operators page and all out other types

This commit is contained in:
Laura Pacilio 2022-04-20 11:46:37 -04:00
parent ba3bb5ad5d
commit 7a43db405c

View File

@ -189,6 +189,16 @@ in a condition as long as the expression is valid and returns a boolean result.
The following language features are particularly useful when writing condition expressions.
### Logical Operators
Use the logical operators `&&` (AND), `||` (OR), and `!` (NOT) to combine multiple conditions together.
```hcl
condition = var.name != "" && lower(var.name) == var.name
```
You can also use arithmetic (e.g. `a+b`), equality (eg., `a==b`) and comparison operators (e.g., `a<b`) in condition expressions. Refer to [Arithmetic and Logical Operators](/language/expressions/operators) for details.
### `contains` Function
Use the built-in function `contains` to test whether a given value is one of a set of predefined valid values.
@ -197,14 +207,6 @@ Use the built-in function `contains` to test whether a given value is one of a s
condition = contains(["STAGE", "PROD"], var.environment)
```
### Boolean Operators
Use the boolean operators `&&` (AND), `||` (OR), and `!` (NOT) to combine multiple conditions together.
```hcl
condition = var.name != "" && lower(var.name) == var.name
```
### `length` Function
Require a non-empty list or map by testing the collection's length.