{"action":"opened","issue":{"url":"https://api.github.com/repos/hashicorp/hcl2/issues/62","repository_url":"https://api.github.com/repos/hashicorp/hcl2","labels_url":"https://api.github.com/repos/hashicorp/hcl2/issues/62/labels{/name}","comments_url":"https://api.github.com/repos/hashicorp/hcl2/issues/62/comments","events_url":"https://api.github.com/repos/hashicorp/hcl2/issues/62/events","html_url":"https://github.com/hashicorp/hcl2/issues/62","id":386512743,"node_id":"MDU6SXNzdWUzODY1MTI3NDM=","number":62,"title":"Custom function, create more HCL blocks","user":{"login":"stevenaldinger","id":11810790,"node_id":"MDQ6VXNlcjExODEwNzkw","avatar_url":"https://avatars2.githubusercontent.com/u/11810790?v=4","gravatar_id":"","url":"https://api.github.com/users/stevenaldinger","html_url":"https://github.com/stevenaldinger","followers_url":"https://api.github.com/users/stevenaldinger/followers","following_url":"https://api.github.com/users/stevenaldinger/following{/other_user}","gists_url":"https://api.github.com/users/stevenaldinger/gists{/gist_id}","starred_url":"https://api.github.com/users/stevenaldinger/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stevenaldinger/subscriptions","organizations_url":"https://api.github.com/users/stevenaldinger/orgs","repos_url":"https://api.github.com/users/stevenaldinger/repos","events_url":"https://api.github.com/users/stevenaldinger/events{/privacy}","received_events_url":"https://api.github.com/users/stevenaldinger/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-12-02T00:30:46Z","updated_at":"2018-12-02T00:30:46Z","closed_at":null,"author_association":"NONE","body":"Sorry about the terrible issue title, I have no idea how to make this concise.\r\n\r\nI want to include a forEach function in the HCL eval context (or elsewhere) that lets me take a list of strings and return a list of the block the forEach function was in + one element per block from the list (not sure how to say that better).\r\n\r\nAs an example... given this block:\r\n```\r\nresource \"some_resource\" {\r\n  dns_server = forEach([\"8.8.8.8\", \"8.8.4.4\"])\r\n}\r\n```\r\n\r\nI want to be able to get some near-equivalent of:\r\n\r\n```\r\nresource \"some_resource\" {\r\n  dns_server = \"8.8.8.8\"\r\n}\r\nresource \"some_resource\" {\r\n  dns_server = \"8.8.4.4\"\r\n}\r\n```\r\n\r\nI found this [example usage of a custom function](https://github.com/hashicorp/hcl2/issues/5) which makes me think it might not be possible to do what I want to do (this way at least).\r\n\r\nCan anyone steer me in the right direction?\r\n\r\nThanks!"}}
{"actor":{"display_login":"stevenaldinger"}}