title: Check if variable exists - Terraform template syntax
body: <p>I'm trying to check if a variable exists on a template file using terraform template syntax, but I get error that <code>This object does not have an attribute named "proxy_set_header</code>.</p>
  
  <pre><code>$ cat nginx.conf.tmpl
  
  %{ for location in jsondecode(locations) }
  location ${location.path} {
      %{ if location.proxy_set_header }
         proxy_set_header ${location.proxy_set_header};
      %{ endif }
  }
  %{ endfor }
  </code></pre>
  
  <p>I tried with <code>if location.proxy_set_header != ""</code> and <code>if location.proxy_set_header</code> without success.</p>
  
  <p>How to check if a variable exists with the String Templates?</p>