-
Notifications
You must be signed in to change notification settings - Fork 38
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
Route is destroyed and recreated when upgrading from 1.2 to 1.3 #40
Comments
I did some more playing around with this on another of our less critical services. After I got the error I reran Terraform and it completely, successfully creating the routes. However during the period between the failure and the rerun there was no 0.0.0.0/0 route so all outgoing traffic over NAT was not working. Depending on your service this may or may not be acceptable. So provided you immediately re-run terraform apply you can minimize the period that you don't have the required fck-nat routes and everything appears to be fine. I would still like to understand if there's anything I can do to prevent the failure entirely, as a minute or two of missing nat routes on some of our services will cause a minor ruckus. |
I have the same problem. I think I got around it just by pointing the route to the module eni_id and not using the update route config input:
It's probably a weird terraform bug. |
Hi @jordanbd , To achieve this without recreating the route you could either edit the state (via moved {
from = module.fck-nat.aws_route.main[0]
to = module.fck-nat.aws_route.main["RESERVED_FKC_NAT"]
} If you are to do this, you may as well update to remove the deprecated code, combining with the moved block as follow: module "fck-nat" {
[...]
update_route_tables = true
route_tables_ids = {
"private" = aws_route_table.private.id
}
}
moved {
from = module.fck-nat.aws_route.main[0]
to = module.fck-nat.aws_route.main["private"]
} You will have to update the above with your use case. Unfortunately I couldn't add the |
@RaJiska Apologies for the lateness of my reply. Your suggestions have worked - I went with your second block where I also removed the deprecated code. Thanks again. |
I'd like some assistance upgrading from 1.2 to 1.3 when using the fck-nat TF module in combination with the TF vpc module.
When I upgrade from 1.2 to 1.3 I get the following error because TF is attempting to recreate my routes:
Error: api error RouteAlreadyExists: Route in Route Table (rtb-xxx) with destination (0.0.0.0/0) already exists
. The TF logs show that the route is being destroyed and recreated:Ideally I would like to upgrade from 1.2 to 1.3 without TF attempting to destroy my routes and recreate them. To achieve this I believe I need to migrate from the deprecated
update_route_table
androute_table_id
properties which were changed in this commit.I am having trouble understanding what I needs to change, hence this ticket.
I have currently defined fck-nat as follows:
My VPC looks something like this:
My goal is to change my fck-nat config in such a way that prevents TF from deleting and recreating my routes (i.e. keeping the name
module.fck-nat[0].aws_route.main[0]
ormodule.fck-nat[0].aws_route.main[1]
instead ofmodule.fck-nat[0].aws_route.main["RESERVED_FKC_NAT"]
. Assistance is appreciated!The text was updated successfully, but these errors were encountered: