nerdexam
HashiCorp

TA-002-P · Question #242

Your developers are facing a lot of problem while writing complex expressions involving difficult interpolations . They have to run the terraform plan every time and check whether there are errors…

The correct answer is A. Use terraform console command to have an interactive UI with full access to the. 'terraform console' opens an interactive REPL (Read-Eval-Print Loop) that lets developers evaluate Terraform expressions, functions, and interpolations in real time against the current state and variables. This eliminates the need to run 'terraform plan' or insert temporary…

Use the Terraform CLI (terraform plan, apply, destroy, fmt, init, validate, workspace, import, taint, providers, output)

Question

Your developers are facing a lot of problem while writing complex expressions involving difficult interpolations . They have to run the terraform plan every time and check whether there are errors , and also check terraform apply to print the value as a temporary output for debugging purposes. What should be done to avoid this?

Options

  • AUse terraform console command to have an interactive UI with full access to the
  • BAdd a breakpoint in your code, using the watch keyword , and output the value to console
  • CUse terraform zipmap function , it will be able to easily do the interpolations without
  • DUse terraform console command to have an interactive UI , but you can only use it with

How the community answered

(37 responses)
  • A
    86% (32)
  • B
    3% (1)
  • C
    3% (1)
  • D
    8% (3)

Explanation

'terraform console' opens an interactive REPL (Read-Eval-Print Loop) that lets developers evaluate Terraform expressions, functions, and interpolations in real time against the current state and variables. This eliminates the need to run 'terraform plan' or insert temporary outputs just to test an expression. It supports all built-in functions (e.g., format, lookup, zipmap) and can reference existing state values.

Topics

#terraform console#debugging#expressions#CLI

Community Discussion

No community discussion yet for this question.

Full TA-002-P Practice