{"action":"created","issue":{"url":"https://api.github.com/repos/hashicorp/terraform/issues/2188","labels_url":"https://api.github.com/repos/hashicorp/terraform/issues/2188/labels{/name}","comments_url":"https://api.github.com/repos/hashicorp/terraform/issues/2188/comments","events_url":"https://api.github.com/repos/hashicorp/terraform/issues/2188/events","html_url":"https://github.com/hashicorp/terraform/issues/2188","id":84044393,"number":2188,"title":"Graph not resolving correctly using modules","user":{"login":"jjshoe","id":2053992,"avatar_url":"https://avatars.githubusercontent.com/u/2053992?v=3","gravatar_id":"","url":"https://api.github.com/users/jjshoe","html_url":"https://github.com/jjshoe","followers_url":"https://api.github.com/users/jjshoe/followers","following_url":"https://api.github.com/users/jjshoe/following{/other_user}","gists_url":"https://api.github.com/users/jjshoe/gists{/gist_id}","starred_url":"https://api.github.com/users/jjshoe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jjshoe/subscriptions","organizations_url":"https://api.github.com/users/jjshoe/orgs","repos_url":"https://api.github.com/users/jjshoe/repos","events_url":"https://api.github.com/users/jjshoe/events{/privacy}","received_events_url":"https://api.github.com/users/jjshoe/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":1,"created_at":"2015-06-02T14:17:52Z","updated_at":"2015-06-02T16:32:43Z","closed_at":null,"body":"I've bumped into a situation where the graph doesn't seem to depend on a module correctly. I've boiled it down to a simple test case:\r\n\r\nThe main terraform file:\r\n```\r\nvariable \"aws_region\" {}\r\nvariable \"aws_access_key\" {}\r\nvariable \"aws_secret_key\" {}\r\n\r\nprovider \"aws\" {\r\n    access_key = \"${var.aws_access_key}\"\r\n    secret_key = \"${var.aws_secret_key}\"\r\n    region = \"${var.aws_region}\"\r\n}\r\n\r\nresource \"aws_vpc\" \"env_vpc\" {\r\n    cidr_block = \"10.1.0.0/16\"\r\n\r\n    tags {\r\n        Name = \"test-vpc\"\r\n    }\r\n}\r\n\r\nresource \"aws_subnet\" \"env_subnet\" {\r\n    vpc_id = \"${aws_vpc.env_vpc.id}\"\r\n    cidr_block = \"10.2.0.0/20\"\r\n    availability_zone = \"us-east-1a\"\r\n    map_public_ip_on_launch = true\r\n\r\n    tags {\r\n        Name = \"test-subnet\"\r\n    }\r\n}\r\n\r\nmodule \"accounts\" {\r\n    source = \"../modules/test_app\"\r\n\r\n    service_subnets = \"${join(\",\", aws_subnet.env_subnet.*.id)}\"\r\n}\r\n```\r\n\r\nThe module:\r\n```\r\nvariable \"service_subnets\" {}\r\n\r\noutput \"test\" {\r\n    value = \"${var.service_subnets}\"\r\n}\r\n```\r\n\r\nExpected:\r\nA list of subnets made\r\n\r\nReceived:\r\n* Resource 'aws_subnet.env_subnet' does not have attribute 'id' for variable 'aws_subnet.env_subnet.*.id'\r\n\r\nGraph:\r\n![graph](https://cloud.githubusercontent.com/assets/2053992/7937910/3787707e-0908-11e5-86c4-96194b58e6be.png)"},"comment":{"url":"https://api.github.com/repos/hashicorp/terraform/issues/comments/108007588","html_url":"https://github.com/hashicorp/terraform/issues/2188#issuecomment-108007588","issue_url":"https://api.github.com/repos/hashicorp/terraform/issues/2188","id":108007588,"user":{"login":"jjshoe","id":2053992,"avatar_url":"https://avatars.githubusercontent.com/u/2053992?v=3","gravatar_id":"","url":"https://api.github.com/users/jjshoe","html_url":"https://github.com/jjshoe","followers_url":"https://api.github.com/users/jjshoe/followers","following_url":"https://api.github.com/users/jjshoe/following{/other_user}","gists_url":"https://api.github.com/users/jjshoe/gists{/gist_id}","starred_url":"https://api.github.com/users/jjshoe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jjshoe/subscriptions","organizations_url":"https://api.github.com/users/jjshoe/orgs","repos_url":"https://api.github.com/users/jjshoe/repos","events_url":"https://api.github.com/users/jjshoe/events{/privacy}","received_events_url":"https://api.github.com/users/jjshoe/received_events","type":"User","site_admin":false},"created_at":"2015-06-02T16:32:43Z","updated_at":"2015-06-02T16:32:43Z","body":"Workaround:\r\n```\r\nvariable \"aws_region\" {}\r\nvariable \"aws_access_key\" {}\r\nvariable \"aws_secret_key\" {}\r\n\r\nprovider \"aws\" {\r\n    access_key = \"${var.aws_access_key}\"\r\n    secret_key = \"${var.aws_secret_key}\"\r\n    region = \"${var.aws_region}\"\r\n}\r\n\r\nresource \"aws_vpc\" \"env_vpc\" {\r\n    cidr_block = \"10.1.0.0/16\"\r\n\r\n    tags {\r\n        Name = \"test-vpc\"\r\n    }\r\n}\r\n\r\nresource \"aws_subnet\" \"env_subnet\" {\r\n    vpc_id = \"${aws_vpc.env_vpc.id}\"\r\n    cidr_block = \"10.2.0.0/20\"\r\n    availability_zone = \"us-east-1a\"\r\n    map_public_ip_on_launch = true\r\n\r\n    tags {\r\n        Name = \"test-subnet\"\r\n    }\r\n}\r\n\r\nresource \"template_file\" \"workaround\" {\r\n    filename = \"./terraform/templates/workaround.tpl\"\r\n\r\n    vars {\r\n        subnets = \"${join(\",\", aws_subnet.env_subnet.*.id)}\"\r\n    }\r\n}\r\n\r\nmodule \"accounts\" {\r\n    source = \"../modules/test_app\"\r\n\r\n    service_subnets = \"${template_file.workaround.vars.subnets}\"\r\n}\r\n```"}}