terraform console
An interactive prompt where you type expressions and see their values, using the current configuration and state, without changing anything.
In more detail
Use it to test a function, inspect a variable or debug a complicated expression before putting it in a local. It needs an initialised directory.
Example
echo 'upper("hi")' | terraform consoleRelated terms
- 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.
- built-in function — One of Terraform's fixed set of functions, such as lower(), join() or jsonencode(), that transform values inside expressions.
- local value — A name for an expression inside a configuration, declared in a locals block and read as local.<name>, which nobody outside can set.
Taught in
- Functions And Expressions In HCL — Infrastructure as Code with Terraform
- Infrastructure As Code, And One Workflow For Every Platform — 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
- Drift: When Reality Stops Matching State — HashiCorp Terraform Associate (004) Exam Prep
- Importing What Terraform Did Not Build — HashiCorp Terraform Associate (004) Exam Prep
- The Full Mock: Sixty Minutes, Eight Areas, One Plan For The Last Week — HashiCorp Terraform Associate (004) Exam Prep