title: Terraform not passing variable to module
body: <p>I'm trying to pass a variable from an environment dir to a module, but having some issues. My directory structure looks like this</p>
  <pre><code>repository
   -&gt; prod
   -&gt; test
        main.tf 
        terraform.tf
        vars.tfvars
   -&gt; modules
       infra
         main.tf
         terraform.tf
  </code></pre>
  <p>In test/main.tf I have</p>
  <pre><code>terraform {
    required_providers {
      aws = {
        source = &quot;hashicorp/aws&quot;
        version = &quot;~&gt; 3.0&quot;
      }
    }
  }
  
  provider &quot;aws&quot; {
    region = &quot;eu-west-1&quot;
  }
  
  module &quot;launch&quot; {
    source = &quot;../../modules/infra&quot;
    range = var.range
  }
  </code></pre>
  <p>test/terraform.tf looks like this</p>
  <pre><code>variable &quot;range&quot; {}
  </code></pre>
  <p>test/vars.tfvars</p>
  <pre><code>range=&quot;10.0.0.0/16&quot;
  </code></pre>
  <p>modules/infra/main.tf</p>
  <pre><code>resource &quot;aws_vpc&quot; &quot;testvpc&quot; {
    cidr_block = var.range
  }
  </code></pre>
  <p>When I run this I get the prompt</p>
  <pre><code>var.range
    Enter a value:
  </code></pre>
  <p>I'm expecting it to pick up the value from the variable automatically, but even when I do enter the value I get the error</p>
  <pre><code>│ Error: Unsupported argument
  on main.tf line 20, in module &quot;launch&quot;:
  range = var.range 
  An argument named &quot;range&quot; is not expected here
  </code></pre>
  <p>Is it possible to pass a variable from a file for a given environment to a module?</p>