title: Reference map in locals in terraform file
body: <p>In a tvfars file I have this: </p>
  
  <pre><code>locals {
      common = {
          "my key" = "value"
      }
  }
  </code></pre>
  
  <p>because I want to use the map in multiple places in that file. I read the terraform docs about variables and I cannot find the correct syntax. I tried the following (var1 and 2 are both declared as maps): </p>
  
  <ol>
  <li><p>With</p>
  
  <pre><code>var1 = "${local.common}"
  var2 = "${local.common}"
  </code></pre>
  
  <p>I get </p>
  
  <pre><code>variable "var1" should be type map, got string
  </code></pre></li>
  <li><p>With </p>
  
  <pre><code>var1 = locals.common
  var2 = locals.common
  </code></pre>
  
  <p>I get </p>
  
  <pre><code>invalid value "myfile.auto.tfvars" for flag -var-file-default: Error parsing myfile.auto.tfvars: At 18:15: Unknown token: 18:15 IDENT locals.common
  </code></pre></li>
  <li><p>With </p>
  
  <pre><code>var1 = {"${local.common}"}
  var2 = {"${local.common}"}
  </code></pre>
  
  <p>which fails without an error message but a print of terraform help and terraform exits. </p></li>
  </ol>
  
  <p>I verified that everything works fine if I copy/paste the map multiple times:</p>
  
  <pre><code>var1 = {
       "my key" = "value"
  }
  var2 = {
       "my key" = "value"
  }
  </code></pre>
  
  <p>Anyone know correct syntax? </p>