{"action":"created","issue":{"url":"https://api.github.com/repos/hashicorp/terraform/issues/7038","repository_url":"https://api.github.com/repos/hashicorp/terraform","labels_url":"https://api.github.com/repos/hashicorp/terraform/issues/7038/labels{/name}","comments_url":"https://api.github.com/repos/hashicorp/terraform/issues/7038/comments","events_url":"https://api.github.com/repos/hashicorp/terraform/issues/7038/events","html_url":"https://github.com/hashicorp/terraform/issues/7038","id":158765848,"number":7038,"title":"Failure while trying to add more routes to a route table.","user":{"login":"feanil","id":781561,"avatar_url":"https://avatars.githubusercontent.com/u/781561?v=3","gravatar_id":"","url":"https://api.github.com/users/feanil","html_url":"https://github.com/feanil","followers_url":"https://api.github.com/users/feanil/followers","following_url":"https://api.github.com/users/feanil/following{/other_user}","gists_url":"https://api.github.com/users/feanil/gists{/gist_id}","starred_url":"https://api.github.com/users/feanil/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/feanil/subscriptions","organizations_url":"https://api.github.com/users/feanil/orgs","repos_url":"https://api.github.com/users/feanil/repos","events_url":"https://api.github.com/users/feanil/events{/privacy}","received_events_url":"https://api.github.com/users/feanil/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/provider/aws","name":"provider/aws","color":"bfdadc"},{"url":"https://api.github.com/repos/hashicorp/terraform/labels/waiting-response","name":"waiting-response","color":"5319e7"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2016-06-06T20:21:09Z","updated_at":"2016-06-15T15:53:53Z","closed_at":null,"body":"Hi there,\r\n\r\nThank you for opening an issue. Please note that we try to keep the Terraform issue tracker reserved for bug reports and feature requests. For general usage questions, please see: https://www.terraform.io/community.html.\r\n\r\n### Terraform Version\r\nTerraform v0.6.16\r\n\r\n### Affected Resource(s)\r\nPlease list the resources as a list, for example:\r\n- aws_route_table\r\n- aws_route\r\n\r\nIf this issue appears to affect multiple resources, it may be an issue with Terraform's core, so please mention this.\r\n\r\n### Terraform Configuration Files\r\n```hcl\r\n# Copy-paste your Terraform configurations here - for large Terraform configs,\r\n# please use a service like Dropbox and share a link to the ZIP file. For\r\n# security, you can also encrypt the files using our GPG public key.\r\n```\r\n\r\n### Debug Output\r\n```\r\nError applying plan:\r\n\r\n3 error(s) occurred:\r\n\r\n* aws_route.route_to_peers.0: diffs didn't match during apply. This is a bug with Terraform and should be reported as a GitHub Issue.\r\n\r\nPlease include the following information in your report:\r\n\r\n    Terraform Version: 0.6.16\r\n    Resource ID: aws_route.route_to_peers.0\r\n    Mismatch reason: attribute mismatch: vpc_peering_connection_id\r\n    Diff One (usually from plan): *terraform.InstanceDiff{Attributes:map[string]*terraform.ResourceAttrDiff{\"vpc_peering_connection_id\":*terraform.ResourceAttrDiff{Old:\"pcx-8a873ee3\", New:\"${element(aws_vpc_peering_connection.peering_connections.*.id, count.index)}\", NewComputed:false, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Type:0x0}}, Destroy:false, DestroyTainted:false}\r\n    Diff Two (usually from apply): *terraform.InstanceDiff{Attributes:map[string]*terraform.ResourceAttrDiff(nil), Destroy:false, DestroyTainted:false}\r\n\r\nAlso include as much context as you can about your config, state, and the steps you performed to trigger this error.\r\n\r\n* aws_route.route_to_peers.1: diffs didn't match during apply. This is a bug with Terraform and should be reported as a GitHub Issue.\r\n\r\nPlease include the following information in your report:\r\n\r\n    Terraform Version: 0.6.16\r\n    Resource ID: aws_route.route_to_peers.1\r\n    Mismatch reason: attribute mismatch: vpc_peering_connection_id\r\n    Diff One (usually from plan): *terraform.InstanceDiff{Attributes:map[string]*terraform.ResourceAttrDiff{\"vpc_peering_connection_id\":*terraform.ResourceAttrDiff{Old:\"pcx-495de520\", New:\"${element(aws_vpc_peering_connection.peering_connections.*.id, count.index)}\", NewComputed:false, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Type:0x0}}, Destroy:false, DestroyTainted:false}\r\n    Diff Two (usually from apply): *terraform.InstanceDiff{Attributes:map[string]*terraform.ResourceAttrDiff(nil), Destroy:false, DestroyTainted:false}\r\n\r\nAlso include as much context as you can about your config, state, and the steps you performed to trigger this error.\r\n\r\n* aws_route.route_to_peers.2: \r\nerror finding matching route for Route table (rtb-924fe6f5) and destination CIDR block (10.3.0.0/16)\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### Panic Output\r\nIf Terraform produced a panic, please provide a link to a GitHub Gist containing the output of the `crash.log`.\r\n\r\n### Expected Behavior\r\nNew routes created.\r\n\r\n### Actual Behavior\r\nAll routes got created but one route was created but not added to the state file.\r\n"},"comment":{"url":"https://api.github.com/repos/hashicorp/terraform/issues/comments/226232179","html_url":"https://github.com/hashicorp/terraform/issues/7038#issuecomment-226232179","issue_url":"https://api.github.com/repos/hashicorp/terraform/issues/7038","id":226232179,"user":{"login":"jniesen","id":853921,"avatar_url":"https://avatars.githubusercontent.com/u/853921?v=3","gravatar_id":"","url":"https://api.github.com/users/jniesen","html_url":"https://github.com/jniesen","followers_url":"https://api.github.com/users/jniesen/followers","following_url":"https://api.github.com/users/jniesen/following{/other_user}","gists_url":"https://api.github.com/users/jniesen/gists{/gist_id}","starred_url":"https://api.github.com/users/jniesen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jniesen/subscriptions","organizations_url":"https://api.github.com/users/jniesen/orgs","repos_url":"https://api.github.com/users/jniesen/repos","events_url":"https://api.github.com/users/jniesen/events{/privacy}","received_events_url":"https://api.github.com/users/jniesen/received_events","type":"User","site_admin":false},"created_at":"2016-06-15T15:53:53Z","updated_at":"2016-06-15T15:53:53Z","body":"@catsby That's the weird thing. They didn't exist until I applied the Terraform a first time. Terraform created them, but didn't record them in the statefile.\r\n\r\nI have a module called vpc_peers that creates a vpc_peering_connection, and entries in a route_table that point to the peer connection. \r\n\r\nThis is the main.tf from the module. It's hosted on a GHE instance so I can't provide a link.\r\n\r\n```hcl\r\nresource \"aws_vpc_peering_connection\" \"peer\" {\r\n  peer_owner_id = \"${var.peer_aws_account}\"\r\n  peer_vpc_id   = \"${var.peer_vpc_id}\"\r\n  vpc_id        = \"${var.vpc_id}\"\r\n}\r\n\r\nresource \"aws_route\" \"private_peer_routes\" {\r\n  count = \"${length(compact(split(\",\", var.peer_private_routes)))}\"\r\n\r\n  route_table_id            = \"${var.private_route_table_id}\"\r\n  destination_cidr_block    = \"${element(split(\",\", var.peer_private_routes), count.index)}\"\r\n  vpc_peering_connection_id = \"${aws_vpc_peering_connection.peer.id}\"\r\n}\r\n\r\nresource \"aws_route\" \"public_peer_routes\" {\r\n  count = \"${length(compact(split(\",\", var.peer_public_routes)))}\"\r\n\r\n  route_table_id            = \"${var.public_route_table_id}\"\r\n  destination_cidr_block    = \"${element(split(\",\", var.peer_public_routes), count.index)}\"\r\n  vpc_peering_connection_id = \"${aws_vpc_peering_connection.peer.id}\"\r\n}\r\n```\r\n\r\nIf you look at the statefile, you can see [one of these modules][foo_to_bop] being applied and recorded in the statefile correctly.\r\n\r\nThen you can see [another one of these modules][foo_to_bar_dev] being applied, but not recorded in the statefile correctly. I say it was applied be the the route table does show a record of the [route being recorded][recorded_route].\r\n\r\n\r\n[foo_to_bop]: https://gist.github.com/jniesen/1d31d61db2e440bd404863d482a63693#file-manheim_dev_vpcs_scrubbed-json-L181-L229 \"peer_foo_to_bop\"\r\n\r\n[foo_to_bar_dev]: https://gist.github.com/jniesen/1d31d61db2e440bd404863d482a63693#file-manheim_dev_vpcs_scrubbed-json-L230-L255 \"peer_foo_to_bar_dev\"\r\n\r\n[recorded_route]: https://gist.github.com/jniesen/1d31d61db2e440bd404863d482a63693#file-manheim_dev_vpcs_scrubbed-json-L346-L351 \"recorded_route\""}}
{"actor":{"display_login":"jniesen"}}