{"action":"created","issue":{"url":"https://api.github.com/repos/hashicorp/terraform/issues/2708","labels_url":"https://api.github.com/repos/hashicorp/terraform/issues/2708/labels{/name}","comments_url":"https://api.github.com/repos/hashicorp/terraform/issues/2708/comments","events_url":"https://api.github.com/repos/hashicorp/terraform/issues/2708/events","html_url":"https://github.com/hashicorp/terraform/issues/2708","id":94723392,"number":2708,"title":"B780FFEC-B661-4EB8-9236-A01737AD98B6 bug","user":{"login":"hd-deman","id":705532,"avatar_url":"https://avatars.githubusercontent.com/u/705532?v=3","gravatar_id":"","url":"https://api.github.com/users/hd-deman","html_url":"https://github.com/hd-deman","followers_url":"https://api.github.com/users/hd-deman/followers","following_url":"https://api.github.com/users/hd-deman/following{/other_user}","gists_url":"https://api.github.com/users/hd-deman/gists{/gist_id}","starred_url":"https://api.github.com/users/hd-deman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hd-deman/subscriptions","organizations_url":"https://api.github.com/users/hd-deman/orgs","repos_url":"https://api.github.com/users/hd-deman/repos","events_url":"https://api.github.com/users/hd-deman/events{/privacy}","received_events_url":"https://api.github.com/users/hd-deman/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-07-13T13:40:22Z","updated_at":"2015-07-13T17:36:03Z","closed_at":null,"body":"```\r\n#resource\r\nresource \"template_file\" \"ansible_hosts_template\" {\r\n    filename = \"ansible_hosts.tpl\"\r\n    vars {\r\n        aws_weave = \"${formatlist(\"%s:%d\\n\", aws_instance.weave.*.public_ip, 888)}\"\r\n    }\r\n}\r\n\r\noutput \"ansible_hosts\" {\r\n    value = \"${template_file.ansible_hosts_template.rendered}\"\r\n}\r\n```\r\n\r\n```\r\n#template\r\n[aws_weave]\r\n${aws_weave}\r\n```\r\n\r\nResult have unexpected prefix\r\n```\r\n#result\r\n[aws_weave]\r\nB780FFEC-B661-4EB8-9236-A01737AD98B652.16.214.17:888\r\nB780FFEC-B661-4EB8-9236-A01737AD98B652.18.133.153:888\r\nB780FFEC-B661-4EB8-9236-A01737AD98B652.18.84.26:888\r\nB780FFEC-B661-4EB8-9236-A01737AD98B6\r\n```"},"comment":{"url":"https://api.github.com/repos/hashicorp/terraform/issues/comments/121001189","html_url":"https://github.com/hashicorp/terraform/issues/2708#issuecomment-121001189","issue_url":"https://api.github.com/repos/hashicorp/terraform/issues/2708","id":121001189,"user":{"login":"thegedge","id":833576,"avatar_url":"https://avatars.githubusercontent.com/u/833576?v=3","gravatar_id":"","url":"https://api.github.com/users/thegedge","html_url":"https://github.com/thegedge","followers_url":"https://api.github.com/users/thegedge/followers","following_url":"https://api.github.com/users/thegedge/following{/other_user}","gists_url":"https://api.github.com/users/thegedge/gists{/gist_id}","starred_url":"https://api.github.com/users/thegedge/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thegedge/subscriptions","organizations_url":"https://api.github.com/users/thegedge/orgs","repos_url":"https://api.github.com/users/thegedge/repos","events_url":"https://api.github.com/users/thegedge/events{/privacy}","received_events_url":"https://api.github.com/users/thegedge/received_events","type":"User","site_admin":false},"created_at":"2015-07-13T17:36:03Z","updated_at":"2015-07-13T17:36:03Z","body":"I think the only fix here would be to have the template provider automatically join string lists, but what should the default delimeter be? Empty string? Space? Newline? Comma?\r\n\r\nI believe another option which makes this join more explicit is:\r\n```\r\n#resource\r\nresource \"template_file\" \"ansible_hosts_template\" {\r\n    filename = \"ansible_hosts.tpl\"\r\n    vars {\r\n        aws_weave = \"${formatlist(\"%s:%d\", aws_instance.weave.*.public_ip, 888)}\"\r\n    }\r\n}\r\n\r\noutput \"ansible_hosts\" {\r\n    value = \"${join(\"\\n\", template_file.ansible_hosts_template.rendered)}\"\r\n}\r\n```"}}