{"action":"created","issue":{"url":"https://api.github.com/repos/hashicorp/terraform/issues/5016","repository_url":"https://api.github.com/repos/hashicorp/terraform","labels_url":"https://api.github.com/repos/hashicorp/terraform/issues/5016/labels{/name}","comments_url":"https://api.github.com/repos/hashicorp/terraform/issues/5016/comments","events_url":"https://api.github.com/repos/hashicorp/terraform/issues/5016/events","html_url":"https://github.com/hashicorp/terraform/issues/5016","id":131691927,"number":5016,"title":"template: Incorrect report of wrong variable notation","user":{"login":"radeksimko","id":287584,"avatar_url":"https://avatars.githubusercontent.com/u/287584?v=3","gravatar_id":"","url":"https://api.github.com/users/radeksimko","html_url":"https://github.com/radeksimko","followers_url":"https://api.github.com/users/radeksimko/followers","following_url":"https://api.github.com/users/radeksimko/following{/other_user}","gists_url":"https://api.github.com/users/radeksimko/gists{/gist_id}","starred_url":"https://api.github.com/users/radeksimko/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/radeksimko/subscriptions","organizations_url":"https://api.github.com/users/radeksimko/orgs","repos_url":"https://api.github.com/users/radeksimko/repos","events_url":"https://api.github.com/users/radeksimko/events{/privacy}","received_events_url":"https://api.github.com/users/radeksimko/received_events","type":"User","site_admin":false},"labels":[{"id":85946957,"url":"https://api.github.com/repos/hashicorp/terraform/labels/bug","name":"bug","color":"f7c6c7","default":true},{"id":127939292,"url":"https://api.github.com/repos/hashicorp/terraform/labels/core","name":"core","color":"cccccc","default":false}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":7,"created_at":"2016-02-05T16:47:26Z","updated_at":"2016-11-22T18:10:08Z","closed_at":"2016-11-22T18:10:08Z","body":"Take the following example:\n\n```\nHi ${foo}, ${bar}\n```\n\n``` hcl\nvariable \"var1\" {\n    default = \"Yoda\"\n}\n\nresource \"template_file\" \"default\" {\n  template = \"${file(\"template.tpl\")}\"\n  vars {\n    foo = \"${var.var1}\"\n    bar = \"${var1}\"\n  }\n}\n```\n\nand run\n\n```\n$ terraform apply\n```\n\n```\nError applying plan:\n\n1 error(s) occurred:\n\n* template_file.default: failed to render : 1:6: unknown variable accessed: foo\n\nTerraform does not automatically rollback in the face of errors.\nInstead, your Terraform state file has been partially updated with\nany resources that successfully completed. Please address the error\nabove and apply again to incrementally change your infrastructure.\n```\n1. The reported line number is incorrect - in fact I'm not sure if this line number is coming from the template or the HCL.\n2. The variable which is actually spelled correctly is reported as unknown, where's the misspelled one is not reported at all.\n\n---\n\nI'm not sure whether this is an issue related to `template_file` resource or core or HCL parser, I found the error message in `./config/lang/` so I categorised this as `core`.\n"},"comment":{"url":"https://api.github.com/repos/hashicorp/terraform/issues/comments/262319034","html_url":"https://github.com/hashicorp/terraform/issues/5016#issuecomment-262319034","issue_url":"https://api.github.com/repos/hashicorp/terraform/issues/5016","id":262319034,"user":{"login":"mitchellh","id":1299,"avatar_url":"https://avatars.githubusercontent.com/u/1299?v=3","gravatar_id":"","url":"https://api.github.com/users/mitchellh","html_url":"https://github.com/mitchellh","followers_url":"https://api.github.com/users/mitchellh/followers","following_url":"https://api.github.com/users/mitchellh/following{/other_user}","gists_url":"https://api.github.com/users/mitchellh/gists{/gist_id}","starred_url":"https://api.github.com/users/mitchellh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mitchellh/subscriptions","organizations_url":"https://api.github.com/users/mitchellh/orgs","repos_url":"https://api.github.com/users/mitchellh/repos","events_url":"https://api.github.com/users/mitchellh/events{/privacy}","received_events_url":"https://api.github.com/users/mitchellh/received_events","type":"User","site_admin":false},"created_at":"2016-11-22T18:10:08Z","updated_at":"2016-11-22T18:10:08Z","body":"Fixed in 0.8"}}
{"actor":{"display_login":"mitchellh"}}