title: Terraform - Variable defined in "*.auto.tfvars" file, but still cannot be discovered
body: <p>I have the following directory Structure:</p>
  <pre><code>.
  ├── ./first_terraform.tf
  ├── ./modules
  │   └── ./modules/ssh_keys
  │       ├── ./modules/ssh_keys/main.tf
  │       ├── ./modules/ssh_keys/outputs.tf
  │       └── ./modules/ssh_keys/variables.tf
  ├── ./terraform.auto.tfvars
  ├── ./variables.tf
  </code></pre>
  <p>I am trying to pass a variable <code>ssh_key</code> to my child module defined as <code>main.tf</code> inside <code>./modules/ssh_keys/main.tf</code></p>
  <pre><code>resource &quot;aws_key_pair&quot; &quot;id_rsa_ec2&quot; {
    key_name   = &quot;id_rsa_ec2&quot;
    public_key = file(var.ssh_key)
  }
  </code></pre>
  <p>I also have this variable defined both at <code>root</code> and <code>child</code> level <code>variables.tf</code> file. For the value, I have set it in <code>terraform.auto.tfvars</code> as below</p>
  <pre><code># SSH Key
  ssh_key = &quot;~/.ssh/haha_key.pub&quot;
  </code></pre>
  <p>I also have a variable defined in root level and child level <code>variables.tf</code> file:</p>
  <pre><code>variable &quot;ssh_key&quot; {
    type        = string
    description = &quot;ssh key for EC2 login and checks&quot;
  }
  </code></pre>
  <p>My root terraform configuration has this module declared as:</p>
  <pre><code>module &quot;ssh_keys&quot; {
    source = &quot;./modules/ssh_keys&quot;
  }
  </code></pre>
  <p>I first did a <code>terraform init -upgrade</code> on my root level. Then ran <code>terraform refresh</code> and got hit by the following error.</p>
  <pre><code>Error: Missing required argument
  
    on first_terraform.tf line 69, in module &quot;ssh_keys&quot;:
    69: module &quot;ssh_keys&quot; {
  
  The argument &quot;ssh_key&quot; is required, but no definition was found.
  </code></pre>
  <p>Just for reference, line 69 in my root level configuration is where the <code>module</code> declaration has been made. I don't know what I have done wrong here. It seems I have all the variables declared, so am I missing some relationship between root/child module variable passing etc.?</p>
  <p>Any help is appreciated! Thanks</p>