-
Notifications
You must be signed in to change notification settings - Fork 9.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error creating route for VPC peering connections #8530
Comments
Update: I've found, through trial and error and copying code examples I found online, that most of the issues I describe in this bug are resolved by adding two resource "aws_route" "internet" {
route_table_id = "${aws_route_table.public.id}"
destination_cidr_block = "0.0.0.0/0"
gateway_id = "${aws_internet_gateway.main.id}"
# A workaround for a series of eventual consistency bugs in Terraform. For a list of the errors, see the related
# bugs described in this issue: https://github.com/hashicorp/terraform/issues/8542. The workaround is based on:
# https://github.com/hashicorp/terraform/issues/5335 and https://charity.wtf/2016/04/14/scrapbag-of-useful-terraform-tips/
depends_on = ["aws_internet_gateway.main", "aws_route_table.public"]
} I have no idea why that helps, but it gets rid of most issues. The only one it does NOT get rid of is #8542. |
This error is back and I can't seem to work around it. When I try to create routes for a VPC peering connection with terraform 0.7.8, I see:
|
Update: I took a look at the route table and the route for
My interpretation is that when I ran In short, it looks like Terraform may fail to record state (such as a route table entry) when a |
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further. |
Terraform Version
Terraform v0.7.2
Affected Resource(s)
Terraform Configuration Files
The full set of templates is fairly big. It creates a VPC, a number of routes, an internet gateway, nat gateway, network ACLs, peering connections, and so on. The routes for the VPC peering connections are what seem to cause the problem:
Note that this code has not yet been updated to take advantage of first-class support for lists in Terraform 0.7.x. Is it possible that has anything to do with the problem?
Expected Behavior
In Terraform 0.6.x, this would create the VPC, routes, and peering connections, usually without problems.
Actual Behavior
On almost every single run with Terraform 0.7.x, I get errors like the following:
Of course, none of these routes actually existed before I ran
terraform apply
, so there must be some issue with Terraform trying to create them twice.Steps to Reproduce
terraform apply
The text was updated successfully, but these errors were encountered: