-
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
Routing table entry keeps being rebuilt #7303
Comments
Are you defining any routes in the default If you are, take a look at the "note" on the |
What @jrnt30 is indeed correct - aws_route and aws_route_table with routes in it compete against each other. This is why we get the remove then readd behaviour this is a known limitation Paul |
Could this be reopened with a documentation tag added? I was just struck with this as well and after reading the doc referenced above (#7303 (comment)) and this issue several times, I finaly managed to figured out how to solve this. If I could suggest that something like this be added to the doc page to make it (more) obvious:That is, creating a resource like this:
and then reference it with:
will make the two resources being recreated every time. Instead, remove the
|
Hi @FransUrbo This is already documented https://www.terraform.io/docs/providers/aws/r/route.html and https://www.terraform.io/docs/providers/aws/r/route_table.html
Hope this is sufficient? P. |
A better idea would be to create a Caveats at the very bottom with the additional information. That way that Caveats topic could reoccur on all pages to clearify things that needs clarifying. |
@FransUrbo we use the Note syntax for that - it usually happens at the top of every page that requires it. Launch Config and AutoScaling groups are another area we do this on |
Just a suggestion. I'm sure there are cases where there's need for "more verbose notes" than the ones at the top. A Caveats would fit that perfectly I think. |
On Oct 25, 2016, at 1:25 PM, Paul Stack wrote:
Yes, I know. What I'm saying is that I don't think it's obvious enough. |
Why support inline routes at all if using them causes the resource to be recreated every time? I'm assuming it has to be this way for some reason. I'd rather have a warning or error from terraform telling me I'm doing something dumb than have it quietly let me do something that will cause problems later. |
Using inline routes does not cause the resource to be created every time... using both inline routes and external routes (via Originally you could only define routes inline. The resource was designed much like most others: here is the resource, this is what it should look like, and only this. If you detect different, tell me. Over time, especially with the introduction of modules, it became necessary to define a route in a module (or otherwise external one) and append routes to it as needed. Naturally, with the above defined behavior, this wouldn't work, we couldn't add rules later unless it was directly to the module. So, a compromise was made: one or the other. With this, you can export a route table id from the module, and consumers of the module can append rules to it, but can only remove rules said consumer knows about. |
I noticed some wonky behaviour when using
|
@jasonrogena That is most likely an AWS eventual consistency issue. Terraform created the route successfully, then queries AWS to find its ID. But AWS returned nothing because the route had not yet propagated through all of AWS's API endpoints. The solution here is just to re-run Note that, in my team's experience, you're more likely to experience these issues when using an AWS region that's physically far away from you, though you can still experience them when using the closest region. |
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.6.16
Affected Resource(s)
Terraform Configuration Files
vpc-peering module:
top-level terraform template:
Expected Behavior
Terraform correctly creates these resources on the first
terraform apply
. Repeated use ofterraform plan
andterraform apply
should show no change in resources.Actual Behavior
Terraform correctly creates these resources on the first
terraform apply
. Without modifying the templates, when I runterraform plan
I get:I
terraform apply
this, it completes successfully. Then I runterraform plan
again and terraform wants to re-create the route it just destroyed:This behavior continues indefinitely.
Important Factoids
We're setting up Route Tables in the context of VPC Peering to connect multiple different VPCs. Each VPC's terraform state is stored in a separate
.tfstate
file in S3.References
The text was updated successfully, but these errors were encountered: