title: Terraform template_file does not have attribute 'rendered' on destroy
body: <p>I get an error when running <code>terraform destroy</code> where I have an output that is the result of a <code>template_file</code> resource, whose contents depend on resources that are destroyed.</p>
  
  <pre><code>data "template_file" "ansible_inventory" {
    template = "${ ...interpolated string that uses values from the ec2 resources in the next line (e.g. ip addresses etc)... }"
    depends_on = [ ...list of ec2 resources... ]
  }
  
  output "ansible_inventory" {
    value = "${data.template_file.ansible_inventory.rendered}"
  }
  </code></pre>
  
  <p>When I do a destroy, I get an error:</p>
  
  <p><code>Resource 'data.template_file.ansible_inventory' does not have attribute 'rendered' for variable 'data.template_file.ansible_inventory.rendered'</code></p>
  
  <p>Is there a workaround for this? This appears to be the same problem reported here: <a href="https://stackoverflow.com/questions/52035992/resource-data-template-file-user-data-does-not-have-attribute-rendered">Resource &#39;data.template_file.user_data&#39; does not have attribute &#39;rendered&#39;</a></p>