{"action":"created","issue":{"url":"https://api.github.com/repos/poseidon/typhoon/issues/224","repository_url":"https://api.github.com/repos/poseidon/typhoon","labels_url":"https://api.github.com/repos/poseidon/typhoon/issues/224/labels{/name}","comments_url":"https://api.github.com/repos/poseidon/typhoon/issues/224/comments","events_url":"https://api.github.com/repos/poseidon/typhoon/issues/224/events","html_url":"https://github.com/poseidon/typhoon/pull/224","id":325096135,"number":224,"title":"Render etcd_initial_cluster using a template_file","user":{"login":"bendrucker","id":808808,"avatar_url":"https://avatars0.githubusercontent.com/u/808808?v=4","gravatar_id":"","url":"https://api.github.com/users/bendrucker","html_url":"https://github.com/bendrucker","followers_url":"https://api.github.com/users/bendrucker/followers","following_url":"https://api.github.com/users/bendrucker/following{/other_user}","gists_url":"https://api.github.com/users/bendrucker/gists{/gist_id}","starred_url":"https://api.github.com/users/bendrucker/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bendrucker/subscriptions","organizations_url":"https://api.github.com/users/bendrucker/orgs","repos_url":"https://api.github.com/users/bendrucker/repos","events_url":"https://api.github.com/users/bendrucker/events{/privacy}","received_events_url":"https://api.github.com/users/bendrucker/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-05-21T23:52:55Z","updated_at":"2018-05-22T16:18:07Z","closed_at":null,"author_association":"NONE","pull_request":{"url":"https://api.github.com/repos/poseidon/typhoon/pulls/224","html_url":"https://github.com/poseidon/typhoon/pull/224","diff_url":"https://github.com/poseidon/typhoon/pull/224.diff","patch_url":"https://github.com/poseidon/typhoon/pull/224.patch"},"body":"This renders the value for `etcd_initial_cluster` using a different strategy to help work around a terraform bug. The resulting value is unchanged. I found that the `null_resource` setup that's currently present causes errors with the following (simplified) setup:\r\n\r\n```hcl\r\nresource \"aws_route53_zone\" \"cluster\" {\r\n  name = \"kubernetes.cluster\"\r\n}\r\n\r\nmodule \"typhoon-aws\" {\r\n  source = \"git::https://github.com/poseidon/typhoon//aws/container-linux/kubernetes\"\r\n  dns_zone = \"${aws_route53_zone.cluster.name}\"\r\n  dns_zone_id = \"${aws_route53_zone.cluster.zone_id}\"\r\n}\r\n```\r\n\r\nThe important distinction here is that the DNS zone name and ID are not available in the plan phase and depend on the creation of another resource. In my project, I'm passing in a zone ID and using the `aws_route53_zone` data source in another module to resolve the name for typhoon.\r\n\r\nUsing this setup, `terraform plan` fails with the following error:\r\n\r\n```\r\nError: Error running plan: 1 error(s) occurred:\r\n\r\n* module.typhoon.data.template_file.controller_config: 2 error(s) occurred:\r\n\r\n* module.typhoon.data.template_file.controller_config[1]: Resource 'null_resource.repeat' does not have attribute 'triggers.name' for variable 'null_resource.repeat.*.triggers.name'\r\n* module.typhoon.data.template_file.controller_config[0]: Resource 'null_resource.repeat' does not have attribute 'triggers.domain' for variable 'null_resource.repeat.*.triggers.domain'\r\n```\r\n\r\nIt appears that triggers are only exported as attributes for a `null_resource` when those values are available synchronously. This seems to be a Terraform bug—I'm adding comments to https://github.com/hashicorp/terraform/issues/17641.\r\n\r\nUsing a `template_file` data source resolves the error on plan and results in a working project. While it's a little verbose to have to re-specify `vars {}`, I also think it's easier to understand."},"comment":{"url":"https://api.github.com/repos/poseidon/typhoon/issues/comments/391051770","html_url":"https://github.com/poseidon/typhoon/pull/224#issuecomment-391051770","issue_url":"https://api.github.com/repos/poseidon/typhoon/issues/224","id":391051770,"user":{"login":"bendrucker","id":808808,"avatar_url":"https://avatars0.githubusercontent.com/u/808808?v=4","gravatar_id":"","url":"https://api.github.com/users/bendrucker","html_url":"https://github.com/bendrucker","followers_url":"https://api.github.com/users/bendrucker/followers","following_url":"https://api.github.com/users/bendrucker/following{/other_user}","gists_url":"https://api.github.com/users/bendrucker/gists{/gist_id}","starred_url":"https://api.github.com/users/bendrucker/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bendrucker/subscriptions","organizations_url":"https://api.github.com/users/bendrucker/orgs","repos_url":"https://api.github.com/users/bendrucker/repos","events_url":"https://api.github.com/users/bendrucker/events{/privacy}","received_events_url":"https://api.github.com/users/bendrucker/received_events","type":"User","site_admin":false},"created_at":"2018-05-22T16:18:07Z","updated_at":"2018-05-22T16:18:07Z","author_association":"NONE","body":"Sounds good, thanks!"}}
{"actor":{"display_login":"bendrucker"}}