{"action":"created","issue":{"url":"https://api.github.com/repos/hashicorp/terraform/issues/2932","labels_url":"https://api.github.com/repos/hashicorp/terraform/issues/2932/labels{/name}","comments_url":"https://api.github.com/repos/hashicorp/terraform/issues/2932/comments","events_url":"https://api.github.com/repos/hashicorp/terraform/issues/2932/events","html_url":"https://github.com/hashicorp/terraform/issues/2932","id":99023313,"number":2932,"title":"There must be a better way to create a targetpool with Google?","user":{"login":"wint00","id":13508445,"avatar_url":"https://avatars.githubusercontent.com/u/13508445?v=3","gravatar_id":"","url":"https://api.github.com/users/wint00","html_url":"https://github.com/wint00","followers_url":"https://api.github.com/users/wint00/followers","following_url":"https://api.github.com/users/wint00/following{/other_user}","gists_url":"https://api.github.com/users/wint00/gists{/gist_id}","starred_url":"https://api.github.com/users/wint00/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wint00/subscriptions","organizations_url":"https://api.github.com/users/wint00/orgs","repos_url":"https://api.github.com/users/wint00/repos","events_url":"https://api.github.com/users/wint00/events{/privacy}","received_events_url":"https://api.github.com/users/wint00/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/hashicorp/terraform/labels/provider/google-cloud","name":"provider/google-cloud","color":"bfdadc"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-08-04T17:53:20Z","updated_at":"2015-08-19T06:30:03Z","closed_at":null,"body":"I've tried several ways and the only one that works for me is:\r\n\r\n```ruby\r\nresource \"google_compute_target_pool\" \"tp-proxy\" {\r\n\r\n    name = \"tp-proxy\"\r\n\r\n    instances = [ \"${var.region}-${element(split(\",\", var.zones), count.index)}/proxy-00\", \"${var.region}-${element(split(\",\", var.zones), count.index+1)}/proxy-01\", \"${var.region}-${element(split(\",\", var.zones), count.index+2)}/proxy-02\" ]\r\n\r\n    health_checks = [ \"hc-proxy\" ]\r\n\r\n    depends_on = [ \"google_compute_http_health_check.hc-proxy\" ]\r\n}\r\n```\r\n\r\nWhat I want to do is to allow the resource to discover the proxies. Something like this, though it doesn't work:\r\n\r\n```ruby\r\nresource \"google_compute_target_pool\" \"tp-proxy\" {\r\n\r\n    name = \"tp-proxy\"\r\n\r\n    instances = [ \"${google_compute_instance.proxy.*.zone/(google_compute_instance.proxy.*.name)}\r\n}\r\n```\r\n\r\nAny suggestions would be appreciated."},"comment":{"url":"https://api.github.com/repos/hashicorp/terraform/issues/comments/132461723","html_url":"https://github.com/hashicorp/terraform/issues/2932#issuecomment-132461723","issue_url":"https://api.github.com/repos/hashicorp/terraform/issues/2932","id":132461723,"user":{"login":"sparkprime","id":168158,"avatar_url":"https://avatars.githubusercontent.com/u/168158?v=3","gravatar_id":"","url":"https://api.github.com/users/sparkprime","html_url":"https://github.com/sparkprime","followers_url":"https://api.github.com/users/sparkprime/followers","following_url":"https://api.github.com/users/sparkprime/following{/other_user}","gists_url":"https://api.github.com/users/sparkprime/gists{/gist_id}","starred_url":"https://api.github.com/users/sparkprime/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sparkprime/subscriptions","organizations_url":"https://api.github.com/users/sparkprime/orgs","repos_url":"https://api.github.com/users/sparkprime/repos","events_url":"https://api.github.com/users/sparkprime/events{/privacy}","received_events_url":"https://api.github.com/users/sparkprime/received_events","type":"User","site_admin":false},"created_at":"2015-08-19T06:30:03Z","updated_at":"2015-08-19T06:30:03Z","body":"Sorry, I didn't notice this issue until now.\r\n\r\nThis looks like a config / interpolation question, so retagging as core.  I think the question is how to assemble a list of strings of zone / instance name given a roundrobin assignment of zones to instances in a cluster of instance created with the 'count' attribute.\r\n\r\nI will say that ${} should not be used in the target pool, as the target pool does not need to exist before the instances exist, and ForceNew on the instances should not ForceNew the target pool (to do so would cause an outage).  So this is purely an exercise in string construction, not in referencing computed attributes / creating dependencies."}}