title: Terraform throws an error "Error: invalid character 'w' looking for beginning of value"
body: <p>i have some code in terraform</p>
  <pre><code>resource &quot;vault_generic_secret&quot; &quot;endpoint&quot; {
    count = var.elasticache-create ? 1 : 0
    path  = &quot;platforms/${var.iad_platform}/${var.iad_region}/${var.iad_environment}/${var.iad_component}/elasticache_endpoint&quot;
    data_json = data.template_file.es-endpoint.rendered
  }
  
  
  data &quot;template_file&quot; &quot;es-endpoint&quot; {
    template = file(&quot;templates/endpoint.tpl&quot;)
  
    vars = {
      elasticache_endpoint = aws_elasticache_replication_group.this[0].configuration_endpoint_address
    }
  }
  </code></pre>
  <p>but when a apply that it says . i think the issue is when terraform parsing the json file, but still don't know what is wrong</p>
  <pre><code>data.template_file.es-endpoint: Refreshing state...
  
  Error: invalid character 'w' looking for beginning of value
  
    on elasticache.tf line 88, in resource &quot;vault_generic_secret&quot; &quot;endpoint&quot;:
    88: resource &quot;vault_generic_secret&quot; &quot;endpoint&quot; {
  
  </code></pre>
  <p><code>endpoint.tpl</code></p>
  <pre><code>{
    &quot;ELASTICACHE_ENDPOINT&quot;: ${elasticache_endpoint}
  }
  </code></pre>