Terraform expression
Anything that produces a value on the right of an equals sign: a literal, a reference, a function call, a for expression or a conditional.
In more detail
Terraform evaluates expressions and builds its dependency graph before asking any provider to act. Functions and expressions only transform values in memory; only resources and data sources touch the outside world. Read a complicated expression from its input type through each step.
Related terms
- built-in function — One of Terraform's fixed set of functions, such as lower(), join() or jsonencode(), that transform values inside expressions.
- for expression — An expression that builds a new list or map by transforming each element of another collection, as in [for n in var.names : lower(n)].
- conditional expression — An expression that checks a condition and evaluates to one of two values, one for true and one for false.
- resource reference — An expression such as aws_vpc.main.id that reads a value from another block by its address.
Taught in
- Writing Your First Configuration In HCL — Infrastructure as Code with Terraform
- Functions And Expressions In HCL — Infrastructure as Code with Terraform
- Scaling Resources With Count — Infrastructure as Code with Terraform
- One Hour, No Weights Published — HashiCorp Terraform Associate (004) Exam Prep
- Resources, Data Sources And The References Between Them — HashiCorp Terraform Associate (004) Exam Prep
- Input Variables, Outputs, And Which Value Wins — HashiCorp Terraform Associate (004) Exam Prep
- Complex Types: Lists, Sets, Maps, Objects And Tuples — HashiCorp Terraform Associate (004) Exam Prep
- Expressions And Functions: Making Configuration Compute — HashiCorp Terraform Associate (004) Exam Prep
- Count, For Each And Dynamic Blocks — HashiCorp Terraform Associate (004) Exam Prep
- Dependencies, depends_on And Lifecycle Rules — HashiCorp Terraform Associate (004) Exam Prep
- Custom Conditions: Validation, Pre And Postconditions, Checks — HashiCorp Terraform Associate (004) Exam Prep