title: Argument required not found while using Terraform validate
body: <p>My Terraform directory structure looks something like :</p>
  <pre><code>├── deploy
  │      ├── dev.tfvars
  │      └── qa.tfvars
  ├── modules
  │   ├── private
  │   │   ├── bastion.tf
  │       ├── db.tf
  │   │   └── variables.tf
  │   └── public
  │       ├── web.tf
  │       └── variables.tf
  ├── main.tf
  
  </code></pre>
  <p>In <strong>bastion.tf</strong>, I am trying to call a variable from <strong>variables.tf</strong> like this :</p>
  <pre><code>resource &quot;aws_eip&quot; &quot;bastion&quot; {
    instance = &quot;var.eip&quot;
    vpc = true
  }
  </code></pre>
  <p>where, <code>eip = 10.x.x.x</code> is set in say, <strong>dev.tfvars</strong>.</p>
  <p>And the configuration for <strong>main.tf</strong> looks like :</p>
  <pre><code>provider &quot;aws&quot; {}
  
  terraform {
    backend &quot;s3&quot; {}
  }
  
  module &quot;private&quot; {
    source = &quot;./modules/private&quot;
  }
  </code></pre>
  <p>While running <strong>terraform validate</strong>, it gives me an error that - <em>The argument &quot;eip&quot; is required, but no definition was found</em>. Even if I try giving eip to module like :</p>
  <pre><code>module &quot;private&quot; {
    source = &quot;./modules/private&quot;
    eip = var.eip
  }
  </code></pre>
  <p>it gives me another error : <a href="https://i.stack.imgur.com/DFRKt.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/DFRKt.png" alt="enter image description here" /></a></p>
  <p><em>An input variable with the name &quot;eip&quot; has not been declared.
  This variable can be declared with a variable &quot;eip&quot; {} block</em></p>
  <p>I have <code>variable &quot;eip&quot; {}</code> already defined in my <strong>variables.tf</strong> such that it takes the values from <strong>.tfvars file</strong>, but somehow it isn't. Can anyone suggest what else could I be missing?</p>