title: How to pass Variables to Terraform modules via CLI or tfvars file?
body: <p>(Please note: after receiving initial answers, this issue seems to not be just an issue with passing the variables, but with modularizing my configurations, note at the bottom where I hardcode the values yet the UI prompts me to provide the values)</p>
  
  <p><a href="https://github.com/mikemcguire/terraform-modules-tfvars" rel="noreferrer">Code example here</a></p>
  
  <p>I've got a project I've broken into the following directory structure</p>
  
  <pre><code>master.tf
  variables.tfvars
  - providers/
  -- digital_ocean/
  --- digital_ocean.tf
  --- variables.tf
  -- cloud_flare/
  --- cloud_flare.tf
  --- variables.tf
  - management/
  -- jenkins/
  --- jenkins-master.tf
  </code></pre>
  
  <p>I'm attempting to pass my Digital Ocean and Cloudflare tokens as variables, to their respective modules. Everything below the root directory is loaded into <code>master.tf</code> as a module.</p>
  
  <p>I have the following in my varaibles.tfvars file:</p>
  
  <pre><code>cloudflare_email  ="service@email.com"
  cloudflare_token  ="TOKEN_STRING"
  do_token          ="${DO_PAT}"
  </code></pre>
  
  <p>The following lines appear in my <code>master.tf</code></p>
  
  <pre><code>variable "do_token" {}
  module "digital_ocean" {
      source          = "./providers/digital_ocean"
      token           = "${var.do_token}"
  }
  
  
  variable "cloudflare_email" {}
  variable "cloudflare_token" {}
  module "cloud_flare" {
      source          = "./providers/cloud_flare"
      email = "${var.cloudflare_email}"
      token = "${var.cloudflare_token}"
  }
  </code></pre>
  
  <p>My digital_ocean module looks like </p>
  
  <pre><code>variable "token" {}
  
  provider "digitalocean" {
    token = "${var.token}"
  }
  </code></pre>
  
  <p>and the cloudflare provider looks like</p>
  
  <pre><code>variable "email" {}
  variable "token" {}
  
  provider "CloudFlare" {
      email = "${var.email}"
      token = "${var.token}"
  }
  </code></pre>
  
  <p>Setting up my jenkins master server on DO</p>
  
  <pre><code>resource "digitalocean_droplet" "jenkins-master" {
  ...
  }
  </code></pre>
  
  <p>From the command line I'm running <code>terraform apply -var-file="variables.tfvars"</code></p>
  
  <p>or I've also tried passing them via the CLI like so..</p>
  
  <pre><code>terraform apply \
    -var "cloudflare_email=service@email.com" \
    -var "cloudflare_token=TOKEN_STRING" \
    -var "do_token=${DO_PAT}"
  </code></pre>
  
  <p>With the above declarations, it will send me into UI mode and prompt me for those variables rather than reading them automatically. I've replicated this behavior on both Terraform v0.9.8 and v0.9.10.</p>
  
  <p>Before I started breaking everything out into separate modules, passing in variables presented no issues. </p>
  
  <p>I've tried pulling the provider declarations into <code>master.tf</code> to see if there were any weird behaviors with modularizing them, with the same behavior. </p>
  
  <p>I also tried hard coding the values into the provider declarations and am experiencing the same behaviors. </p>