$RUN_TASK init (Argument or block definition is required)

Hi Community,

I am working on a huge environment and got the task to make a Linux server up and running. but I am getting a weird error (in line 35 Argument or block definition is required) whereas my code is only in 34 lines.

can someone please guide Thanks in advance.

Hi @Ansar-Yousuf-Zai,

Without seeing a full error message and corresponding code example I can only guess, but if Terraform is reporting a problem at the end of the file (which sounds like what happened in your case) then that suggests a syntax error where an earlier line has opened some sort of container, like a block with an opening brace {, but there’s no corresponding end to that container.

For example, I’d expect an error like what you described if I wrote a configuration like the following:

resource "example" "example" {
# NOTE: no closing brace
β”‚ Error: Argument or block definition required
β”‚   on no-closing-brace.tf line 3, in resource "example" "example":
β”‚    3: 
β”‚ An argument or block definition is required here.
1 Like