{"action":"created","issue":{"url":"https://api.github.com/repos/hashicorp/terraform/issues/6991","repository_url":"https://api.github.com/repos/hashicorp/terraform","labels_url":"https://api.github.com/repos/hashicorp/terraform/issues/6991/labels{/name}","comments_url":"https://api.github.com/repos/hashicorp/terraform/issues/6991/comments","events_url":"https://api.github.com/repos/hashicorp/terraform/issues/6991/events","html_url":"https://github.com/hashicorp/terraform/issues/6991","id":158225752,"number":6991,"title":"Resource does not have attribute 'id' for variable","user":{"login":"carlossg","id":23651,"avatar_url":"https://avatars.githubusercontent.com/u/23651?v=3","gravatar_id":"","url":"https://api.github.com/users/carlossg","html_url":"https://github.com/carlossg","followers_url":"https://api.github.com/users/carlossg/followers","following_url":"https://api.github.com/users/carlossg/following{/other_user}","gists_url":"https://api.github.com/users/carlossg/gists{/gist_id}","starred_url":"https://api.github.com/users/carlossg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/carlossg/subscriptions","organizations_url":"https://api.github.com/users/carlossg/orgs","repos_url":"https://api.github.com/users/carlossg/repos","events_url":"https://api.github.com/users/carlossg/events{/privacy}","received_events_url":"https://api.github.com/users/carlossg/received_events","type":"User","site_admin":false},"labels":[{"id":85946957,"url":"https://api.github.com/repos/hashicorp/terraform/labels/bug","name":"bug","color":"f7c6c7","default":true},{"id":127939292,"url":"https://api.github.com/repos/hashicorp/terraform/labels/core","name":"core","color":"cccccc","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":9,"created_at":"2016-06-02T19:55:39Z","updated_at":"2016-11-04T00:20:53Z","closed_at":null,"body":"We are getting this error from time to time, seems a race condition when AWS is slower than usual\n\n```\n19:29:48 [security-groups] aws_security_group.marker: Creating...\n19:29:48 [security-groups] description:                \"\" => \"Tiger security group\"\n19:29:48 [security-groups] egress.#:                   \"\" => \"<computed>\"\n19:29:48 [security-groups] ingress.#:                  \"\" => \"<computed>\"\n19:29:48 [security-groups] name:                       \"\" => \"pse-integration-marker\"\n19:29:48 [security-groups] owner_id:                   \"\" => \"<computed>\"\n19:29:48 [security-groups] tags.#:                     \"\" => \"3\"\n19:29:48 [security-groups] tags.Name:                  \"\" => \"pse-integration-marker\"\n19:29:48 [security-groups] tags.cloudbees:pse:cluster: \"\" => \"pse-integration\"\n19:29:48 [security-groups] tags.tiger:cluster:         \"\" => \"pse-integration\"\n19:29:48 [security-groups] vpc_id:                     \"\" => \"vpc-9a974bfd\"\n19:29:49 [security-groups] aws_security_group.marker: Creation complete\n19:29:49 [security-groups] Error applying plan:\n19:29:49 [security-groups] \n19:29:49 [security-groups] 1 error(s) occurred:\n19:29:49 [security-groups] \n19:29:49 [security-groups] * Resource 'aws_security_group.marker' does not have attribute 'id' for variable 'aws_security_group.marker.id'\n```\n\nthe terraform.tfstate file seems corrupt, with no info about the security group created\n\n```\n{\n    \"version\": 1,\n    \"serial\": 0,\n    \"modules\": [\n        {\n            \"path\": [\n                \"root\"\n            ],\n            \"outputs\": {},\n            \"resources\": {}\n        }\n    ]\n}\n```\n### Terraform Version\n\n0.6.15\n### Affected Resource(s)\n- aws_security_group\n### Terraform Configuration Files\n\n``` hcl\nresource \"aws_security_group\" \"marker\" {\n    name = \"pse-integration-marker\"\n    description = \"Tiger security group\"\n    tags = {\n        Name = \"pse-integration-marker\"\n        \"tiger:cluster\" = \"pse-integration\"\n        \"cloudbees:pse:cluster\" = \"pse-integration\"\n    }\n    vpc_id = \"vpc-9a974bfd\"\n}\noutput \"marker_security_group\" {\n    value = \"${aws_security_group.marker.id}\"\n}\n```\n### References\n- Related to #6775, happening when AWS has those eventual consistency issues\n"},"comment":{"url":"https://api.github.com/repos/hashicorp/terraform/issues/comments/258312992","html_url":"https://github.com/hashicorp/terraform/issues/6991#issuecomment-258312992","issue_url":"https://api.github.com/repos/hashicorp/terraform/issues/6991","id":258312992,"user":{"login":"josh-padnick","id":4295964,"avatar_url":"https://avatars.githubusercontent.com/u/4295964?v=3","gravatar_id":"","url":"https://api.github.com/users/josh-padnick","html_url":"https://github.com/josh-padnick","followers_url":"https://api.github.com/users/josh-padnick/followers","following_url":"https://api.github.com/users/josh-padnick/following{/other_user}","gists_url":"https://api.github.com/users/josh-padnick/gists{/gist_id}","starred_url":"https://api.github.com/users/josh-padnick/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/josh-padnick/subscriptions","organizations_url":"https://api.github.com/users/josh-padnick/orgs","repos_url":"https://api.github.com/users/josh-padnick/repos","events_url":"https://api.github.com/users/josh-padnick/events{/privacy}","received_events_url":"https://api.github.com/users/josh-padnick/received_events","type":"User","site_admin":false},"created_at":"2016-11-04T00:20:53Z","updated_at":"2016-11-04T00:20:53Z","body":"Just want to add another data point here. I was mysteriously getting the following error consistently (i.e. *not* an AWS eventual consistency issue):\r\n\r\n```\r\nResource 'aws_iam_role.ecs_service_autoscaling_role' does not have attribute 'id' for variable 'aws_iam_role.ecs_service_autoscaling_role.id'\r\n```\r\n\r\nI finally discovered that the real issue was that `aws_iam_role.ecs_service_autoscaling_role` wasn't actually getting created. In fact, Terraform was failing with this error:\r\n\r\n```\r\n* aws_iam_role.ecs_service_autoscaling_role: \"name\" cannot be longer than 64 characters\r\n```\r\n\r\nBut because the execution kept running, the error message I saw wasn't helpful."}}
{"actor":{"display_login":"josh-padnick"}}