{"action":"created","issue":{"url":"https://api.github.com/repos/hashicorp/terraform/issues/6450","repository_url":"https://api.github.com/repos/hashicorp/terraform","labels_url":"https://api.github.com/repos/hashicorp/terraform/issues/6450/labels{/name}","comments_url":"https://api.github.com/repos/hashicorp/terraform/issues/6450/comments","events_url":"https://api.github.com/repos/hashicorp/terraform/issues/6450/events","html_url":"https://github.com/hashicorp/terraform/issues/6450","id":152762380,"number":6450,"title":"using splat within a connection to get self.private_ip doesn't work.","user":{"login":"kuberkaul","id":2179966,"avatar_url":"https://avatars.githubusercontent.com/u/2179966?v=3","gravatar_id":"","url":"https://api.github.com/users/kuberkaul","html_url":"https://github.com/kuberkaul","followers_url":"https://api.github.com/users/kuberkaul/followers","following_url":"https://api.github.com/users/kuberkaul/following{/other_user}","gists_url":"https://api.github.com/users/kuberkaul/gists{/gist_id}","starred_url":"https://api.github.com/users/kuberkaul/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kuberkaul/subscriptions","organizations_url":"https://api.github.com/users/kuberkaul/orgs","repos_url":"https://api.github.com/users/kuberkaul/repos","events_url":"https://api.github.com/users/kuberkaul/events{/privacy}","received_events_url":"https://api.github.com/users/kuberkaul/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/hashicorp/terraform/labels/bug","name":"bug","color":"f7c6c7"},{"url":"https://api.github.com/repos/hashicorp/terraform/labels/core","name":"core","color":"cccccc"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2016-05-03T12:32:39Z","updated_at":"2016-05-14T02:55:29Z","closed_at":null,"body":"Hi there,\r\n\r\nTerraform v0.6.15\r\n\r\nAffected Resource(s)\r\nPlease list the resources as a list, for example:\r\n- connection\r\n\r\n\r\n```hcl\r\n# The Google Compute Engine Instance Group Manager API creates and manages pools of homogeneous Compute Engine virtual machine instances from a common instance template\r\nresource \"google_compute_instance_group_manager\" \"djin-dev-search\" {\r\n  name        = \"djin-dev-search-instances\"\r\n  description = \"This is compute instances group manager for instances while scaling. This is spawned off the template\"\r\n\r\n  base_instance_name = \"djin-dev-search\"\r\n  instance_template  = \"${google_compute_instance_template.djin-dev-search.self_link}\"\r\n  update_strategy    = \"NONE\"\r\n  zone               = \"us-east1-b\"\r\n\r\n  #target_pools = [\"${google_compute_target_pool.foobar.self_link}\"]\r\n  target_size  = 2\r\n\r\n  named_port {\r\n    name = \"https\"\r\n    port = 443\r\n  }\r\n\r\n  named_port {\r\n    name = \"ssh\"\r\n    port = 22\r\n  }\r\n\r\n\r\n  named_port {\r\n    name = \"http\"\r\n    port = 80\r\n  }\r\n\r\n  provisioner \"file\" {\r\n    source = \"${var.install_script_src_path}\"\r\n    destination = \"${var.install_script_dest_path}\"\r\n    connection {\r\n      type = \"ssh\"\r\n      user = \"xyz\"\r\n      host =  \"${self.private_ip}\"\r\n      private_key = \"${file(\"${var.private_key_path}\")}\"\r\n      agent = false\r\n    }\r\n  }\r\n\r\n  /*provisioner \"remote-exec\" {\r\n    connection {\r\n      type = \"ssh\"\r\n      user = \"xyz\"\r\n      host =  \"${self.private_ip}\"\r\n      private_key = \"${file(\"${var.private_key_path}\")}\"\r\n      agent = false\r\n    }\r\n    inline = [\r\n      \"chmod +x ${var.install_script_dest_path}\"\r\n    ]\r\n  }\r\n}\r\n```\r\n\r\n### Debug Output\r\nError applying plan:\r\n1 error(s) occurred:\r\n* Resource 'google_compute_instance_group_manager.djin-dev-search.0' does not have attribute 'private_ip' for variable 'google_compute_instance_group_manager.djin-dev-search.0.private_ip'\r\n\r\nPlease list the steps required to reproduce the issue, for example:\r\n1. `terraform apply`\r\n\r\n### Important Factoids\r\n**Running this for Google Cloud Platform.**\r\n\r\nThe issue is here : ```   host =  \"${self.private_ip}\"```\r\nHow do I use splat is such a scenario to get private_ip for both the vm's created. Also, is the keyword not private_ip for getting the internal ip of instances ? \r\n\r\nI also tried : ```${self.*.private_ip}```"},"comment":{"url":"https://api.github.com/repos/hashicorp/terraform/issues/comments/219196934","html_url":"https://github.com/hashicorp/terraform/issues/6450#issuecomment-219196934","issue_url":"https://api.github.com/repos/hashicorp/terraform/issues/6450","id":219196934,"user":{"login":"kuberkaul","id":2179966,"avatar_url":"https://avatars.githubusercontent.com/u/2179966?v=3","gravatar_id":"","url":"https://api.github.com/users/kuberkaul","html_url":"https://github.com/kuberkaul","followers_url":"https://api.github.com/users/kuberkaul/followers","following_url":"https://api.github.com/users/kuberkaul/following{/other_user}","gists_url":"https://api.github.com/users/kuberkaul/gists{/gist_id}","starred_url":"https://api.github.com/users/kuberkaul/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kuberkaul/subscriptions","organizations_url":"https://api.github.com/users/kuberkaul/orgs","repos_url":"https://api.github.com/users/kuberkaul/repos","events_url":"https://api.github.com/users/kuberkaul/events{/privacy}","received_events_url":"https://api.github.com/users/kuberkaul/received_events","type":"User","site_admin":false},"created_at":"2016-05-14T02:55:29Z","updated_at":"2016-05-14T02:55:29Z","body":"@jen20 @mitchellh  - ping ?"}}