Multiline expression in Terraform console

My problem is I want to enter multi-line expression on terraform console .
So far I only referred “Command: console - Terraform by HashiCorp”.

If I attempt to enter new line, it results in an error:

Error: Invalid expression

 on <console-input> line 1:
(source code not available)

**Expected the start of an expression, but found an invalid expression token.**
3 Likes

Hi @gh4dp,

terraform console doesn’t currently support multi-line expressions. If you want to evaluate a more complex expression then it’ll often be easier to write it in a Terraform configuration file (e.g. as an output value for your root module) and then use terraform plan to see the effect of it, so you can then edit it in a full text editor.

I am also having this issue and just came across this post. I just wanted to express support for being able to use multi-line input in the Terraform console.

1 Like

FYI, I created a relevant feature request here: Multiline support in Terraform console · Issue #32954 · hashicorp/terraform · GitHub

Cheers!

1 Like