{"action":"created","issue":{"url":"https://api.github.com/repos/hashicorp/terraform/issues/2051","labels_url":"https://api.github.com/repos/hashicorp/terraform/issues/2051/labels{/name}","comments_url":"https://api.github.com/repos/hashicorp/terraform/issues/2051/comments","events_url":"https://api.github.com/repos/hashicorp/terraform/issues/2051/events","html_url":"https://github.com/hashicorp/terraform/issues/2051","id":79634570,"number":2051,"title":"provider/aws: elasticache cluster exports nodes before they exist","user":{"login":"juniorplenty","id":941119,"avatar_url":"https://avatars.githubusercontent.com/u/941119?v=3","gravatar_id":"","url":"https://api.github.com/users/juniorplenty","html_url":"https://github.com/juniorplenty","followers_url":"https://api.github.com/users/juniorplenty/followers","following_url":"https://api.github.com/users/juniorplenty/following{/other_user}","gists_url":"https://api.github.com/users/juniorplenty/gists{/gist_id}","starred_url":"https://api.github.com/users/juniorplenty/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/juniorplenty/subscriptions","organizations_url":"https://api.github.com/users/juniorplenty/orgs","repos_url":"https://api.github.com/users/juniorplenty/repos","events_url":"https://api.github.com/users/juniorplenty/events{/privacy}","received_events_url":"https://api.github.com/users/juniorplenty/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-05-22T22:26:31Z","updated_at":"2015-05-22T23:42:18Z","closed_at":null,"body":"Originally reported by @saulshanabrook here: https://github.com/hashicorp/terraform/pull/1965\r\nVerified it still exists in `0.5.2`\r\n\r\n```\r\nError applying plan:\r\n\r\n1 error(s) occurred:\r\n\r\n* 1 error(s) occurred:\r\n\r\n* Resource 'aws_elasticache_cluster.default' does not have attribute 'cache_nodes.0.address' for variable 'aws_elasticache_cluster.default.cache_nodes.0.address'\r\n\r\nTerraform does not automatically rollback in the face of errors.\r\nInstead, your Terraform state file has been partially updated with\r\nany resources that successfully completed. Please address the error\r\nabove and apply again to incrementally change your infrastructure.\r\n```\r\n\r\n`cache_nodes.0` doesn't exist because elasticache isn't really done provisioning the cluster, and terraform doesn't wait for it to do so.\r\n"},"comment":{"url":"https://api.github.com/repos/hashicorp/terraform/issues/comments/104802546","html_url":"https://github.com/hashicorp/terraform/issues/2051#issuecomment-104802546","issue_url":"https://api.github.com/repos/hashicorp/terraform/issues/2051","id":104802546,"user":{"login":"juniorplenty","id":941119,"avatar_url":"https://avatars.githubusercontent.com/u/941119?v=3","gravatar_id":"","url":"https://api.github.com/users/juniorplenty","html_url":"https://github.com/juniorplenty","followers_url":"https://api.github.com/users/juniorplenty/followers","following_url":"https://api.github.com/users/juniorplenty/following{/other_user}","gists_url":"https://api.github.com/users/juniorplenty/gists{/gist_id}","starred_url":"https://api.github.com/users/juniorplenty/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/juniorplenty/subscriptions","organizations_url":"https://api.github.com/users/juniorplenty/orgs","repos_url":"https://api.github.com/users/juniorplenty/repos","events_url":"https://api.github.com/users/juniorplenty/events{/privacy}","received_events_url":"https://api.github.com/users/juniorplenty/received_events","type":"User","site_admin":false},"created_at":"2015-05-22T23:42:18Z","updated_at":"2015-05-22T23:42:18Z","body":"Here are test configs:\r\n\r\n```\r\n### VARS #################################\r\nvariable \"aws_access_key\" {}\r\nvariable \"aws_secret_key\" {}\r\nvariable \"region\" {\r\n  default = \"us-east-1\"\r\n}\r\nvariable \"availability_zone\" {\r\n  default = \"us-east-1e\"\r\n}\r\n\r\n### VPC ##################################\r\nprovider \"aws\" {\r\n  access_key = \"${var.aws_access_key}\"\r\n  secret_key = \"${var.aws_secret_key}\"\r\n  region     = \"${var.region}\"\r\n}\r\nresource \"aws_vpc\" \"default\" {\r\n  cidr_block = \"10.250.0.0/16\"\r\n}\r\nresource \"aws_internet_gateway\" \"default\" {\r\n  vpc_id = \"${aws_vpc.default.id}\"\r\n}\r\nresource \"aws_subnet\" \"public\" {\r\n  vpc_id = \"${aws_vpc.default.id}\"\r\n  cidr_block = \"10.250.2.0/24\"\r\n  availability_zone = \"${var.availability_zone}\"\r\n  map_public_ip_on_launch = true\r\n}\r\nresource \"aws_subnet\" \"private\" {\r\n  vpc_id = \"${aws_vpc.default.id}\"\r\n  cidr_block = \"10.250.3.0/24\"\r\n  availability_zone = \"${var.availability_zone}\"\r\n  map_public_ip_on_launch = true\r\n}\r\nresource \"aws_route_table_association\" \"private\" {\r\n  subnet_id = \"${aws_subnet.private.id}\"\r\n  route_table_id = \"${aws_route_table.public.id}\"\r\n}\r\nresource \"aws_route_table\" \"public\" {\r\n  vpc_id = \"${aws_vpc.default.id}\"\r\n  route {\r\n    cidr_block = \"0.0.0.0/0\"\r\n    gateway_id = \"${aws_internet_gateway.default.id}\"\r\n  }\r\n}\r\nresource \"aws_route_table_association\" \"public\" {\r\n  subnet_id = \"${aws_subnet.public.id}\"\r\n  route_table_id = \"${aws_route_table.public.id}\"\r\n}\r\nresource \"aws_route53_zone\" \"main\" {\r\n  name = \"test.infra\"\r\n  vpc_id = \"${aws_vpc.default.id}\"\r\n}\r\n\r\n### ELASTICACHE ##########################\r\nresource \"aws_elasticache_subnet_group\" \"test\" {\r\n  name = \"test\"\r\n  description = \"Test Redis Subnet Group\"\r\n  subnet_ids = [\"${aws_subnet.private.id}\"]\r\n}\r\nresource \"aws_elasticache_cluster\" \"test\" {\r\n  cluster_id = \"test\"\r\n  subnet_group_name = \"${aws_elasticache_subnet_group.test.name}\"\r\n  num_cache_nodes = 1\r\n  node_type = \"cache.t2.micro\"\r\n  engine = \"redis\"\r\n  engine_version = \"2.8.19\"\r\n  parameter_group_name = \"default.redis2.8\"\r\n}\r\n\r\n### THIS EXPOSES THE CONDITION\r\nresource \"aws_route53_record\" \"test-cache\" {\r\n  zone_id = \"${aws_route53_zone.main.id}\"\r\n  name = \"test-cache\"\r\n  type = \"CNAME\"\r\n  ttl = \"300\"\r\n  records = [\"${ aws_elasticache_cluster.test.cache_nodes.0.address }\"]\r\n}\r\n```"}}