TA-002-P · Question #414
Which command lets you experiment with Terraform's built-in functions?
The correct answer is B. terraform console. The terraform console command opens an interactive REPL where you can evaluate built-in functions and expressions against the current state without modifying infrastructure.
Question
Which command lets you experiment with Terraform's built-in functions?
Options
- Aterraform env
- Bterraform console
- Cterraform test
- Dterraform validate
How the community answered
(22 responses)- B95% (21)
- C5% (1)
Why each option
The terraform console command opens an interactive REPL where you can evaluate built-in functions and expressions against the current state without modifying infrastructure.
terraform env is a legacy alias for terraform workspace and has nothing to do with evaluating functions.
terraform console starts an interactive command-line session that evaluates Terraform expressions and built-in functions in real time. It loads the current state and allows experimentation with functions like cidrsubnet(), toset(), or jsondecode() before committing them to configuration files.
terraform test runs automated tests defined in .tftest.hcl files; it is not an interactive exploration tool.
terraform validate checks configuration syntax and internal consistency but does not evaluate expressions or functions interactively.
Concept tested: Using terraform console to test built-in functions
Source: https://developer.hashicorp.com/terraform/cli/commands/console
Topics
Community Discussion
No community discussion yet for this question.