{"action":"created","issue":{"url":"https://api.github.com/repos/hashicorp/terraform/issues/15476","repository_url":"https://api.github.com/repos/hashicorp/terraform","labels_url":"https://api.github.com/repos/hashicorp/terraform/issues/15476/labels{/name}","comments_url":"https://api.github.com/repos/hashicorp/terraform/issues/15476/comments","events_url":"https://api.github.com/repos/hashicorp/terraform/issues/15476/events","html_url":"https://github.com/hashicorp/terraform/issues/15476","id":240642566,"number":15476,"title":"Increment template","user":{"login":"SDBrett","id":25494777,"avatar_url":"https://avatars3.githubusercontent.com/u/25494777?v=3","gravatar_id":"","url":"https://api.github.com/users/SDBrett","html_url":"https://github.com/SDBrett","followers_url":"https://api.github.com/users/SDBrett/followers","following_url":"https://api.github.com/users/SDBrett/following{/other_user}","gists_url":"https://api.github.com/users/SDBrett/gists{/gist_id}","starred_url":"https://api.github.com/users/SDBrett/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SDBrett/subscriptions","organizations_url":"https://api.github.com/users/SDBrett/orgs","repos_url":"https://api.github.com/users/SDBrett/repos","events_url":"https://api.github.com/users/SDBrett/events{/privacy}","received_events_url":"https://api.github.com/users/SDBrett/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":210040828,"url":"https://api.github.com/repos/hashicorp/terraform/labels/provider/template","name":"provider/template","color":"bfdadc","default":false}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-07-05T12:59:18Z","updated_at":"2017-07-05T16:20:01Z","closed_at":"2017-07-05T16:20:00Z","body":"I'm using a template to provide initial configuration data for my EC2 instances. Part of that configuration is to set a host name using a defined prefix and the counter as a suffix.\r\n\r\nThe result is all instances are getting the same name <prefix>0, as 0 is the first counter index. I use the same variable to set apply tags to the EC2 instance and node in chef and they increment just fine. The only place it doesn't is with the template.\r\n\r\nOn face value it appears that the template does not not reevaluate the passed variables after they are first set.\r\n\r\nThe temple resource is configured as \r\n\r\n```\r\ndata \"template_file\" \"file_server\" {\r\n  template = \"${file(\"userdata.txt\")}\"\r\n  vars {\r\n    admin_password=\"${var.administrator_pw}\"\r\n    hostname = \"${var.file_server.[\"hostname_prefix\"]}-${count.index}\"\r\n  }\r\n}\r\n```\r\n\r\nIt is applied against the AWS resource as \r\n\r\n`[user_data = \"${data.template_file.file_server.rendered}\"]`\r\n\r\nIn the user data file I am referring to the variable with the following line\r\n\r\n`Rename-Computer -NewName \"${hostname}\" -Restart -Confirm:$False`\r\n\r\nI would expect that my servers are named fs-0, fs-1 ..... but the host name is set as fs-0 for every server.\r\n\r\nThis is on Terraform 0.9.6\r\n"},"comment":{"url":"https://api.github.com/repos/hashicorp/terraform/issues/comments/313153064","html_url":"https://github.com/hashicorp/terraform/issues/15476#issuecomment-313153064","issue_url":"https://api.github.com/repos/hashicorp/terraform/issues/15476","id":313153064,"user":{"login":"hashibot","id":26720499,"avatar_url":"https://avatars2.githubusercontent.com/u/26720499?v=3","gravatar_id":"","url":"https://api.github.com/users/hashibot","html_url":"https://github.com/hashibot","followers_url":"https://api.github.com/users/hashibot/followers","following_url":"https://api.github.com/users/hashibot/following{/other_user}","gists_url":"https://api.github.com/users/hashibot/gists{/gist_id}","starred_url":"https://api.github.com/users/hashibot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hashibot/subscriptions","organizations_url":"https://api.github.com/users/hashibot/orgs","repos_url":"https://api.github.com/users/hashibot/repos","events_url":"https://api.github.com/users/hashibot/events{/privacy}","received_events_url":"https://api.github.com/users/hashibot/received_events","type":"User","site_admin":false},"created_at":"2017-07-05T16:20:00Z","updated_at":"2017-07-05T16:20:00Z","body":"This issue has been automatically migrated to terraform-providers/terraform-provider-template#12 because it looks like an issue with that provider. If you believe this is _not_ an issue with the provider, please reply to this issue and let us know."}}
{"actor":{"display_login":"hashibot"}}