-
Notifications
You must be signed in to change notification settings - Fork 9.5k
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
aws_route: continually deletes and re-updates the network_interface_id attribute #4097
Comments
Bump, just ran into this!
On every plan/apply. Interestingly, the routes remain intact, they're not blown away. |
What's happening is that when you specify a route with an instance ID, AWS helpfully finds the ENI ID that it's going to use for that route and adds it to the route object internally. Then, when you run |
Just experienced this as well. No work around eh? |
It really doesn't require a workaround, it doesn't harm anything. |
Maybe it doesn't harm anything, but its certainly a bug as Terraform is indicating there's a state change when there shouldn't be one |
Oh, no doubt it's a bug! I'm simply pointing out that one doesn't need a "workaround", because while annoying, it doesn't negatively impact the system. |
@SpencerBrown, yes it does negatively impact the system, check out the #4105 linked by @pikeas |
I don't think so, see my comment on #4105. |
I just encountered this same issue trying to create a route on a route table for private subnets with a NAT instance as the target. I was able to get around it (stop Terraform from thinking that it needs to make a change) by specifying both the TLDR: if you really want to stop Terraform from thinking that a change needs to be made, specify both the |
I am creating routes to the new AWS NAT gateways and TF updates the routing tables on every run, even though there are no changes:
|
+1, also encountering this issue with aws_route_table. In my case it's with the use of a nat gateway. |
+1. Annoying |
Most likely related to #4311. |
As reported in #4311: #4311 (comment) via @gozer |
Hi @SpencerBrown, I believe this issue has may have been fixed as part of the 0.6.13 release - can you have a look and tell me if your config shows a continual loop still? I have been able to recreate it in 0.6.12 but then it wasn't happening in 0.6.13 Thanks Paul |
I've experienced this on master as recently as today |
@stack72: 0.6.13 fixes the issue for me. You can close this issue, or am I supposed to do that? |
@SpencerBrown this is brilliant news! This to me suggests that the issue that @gozer experienced is a different problem - i will look at this and then close it. Thanks for letting me know so fast @SpencerBrown |
this still happen for me on 0.6.13 |
@einyx can you post a configuration that will help me track down the issue that you are having? Thanks Paul |
OK, I take that back. This is "fixed", at least for the nat gateway use case. After debugging the TF source for a bit I found it was PEBKAC. I made a mistake in my TF configuration: I used
If you look very closely at @mtekel's comment (which is the same I was experiencing), things start to become clear. The aws_route_table route attribute set is migrating from one hash (the number between
We can clearly see that TF is setting gateway_id and unsetting nat_gateway_id. In fact, infrastructure deployed using the nat gateway in the wrong field will still work fine. After debugging the Amazon API call responses, it appears that even if you specify a nat_gateway_id in the gateway_id field for a route create request, amazon will return that id in the nat_gateway_id field. In other words, the AWS API automatically reassigns the nat gateway id to the correct nat gateway field on subsequent read responses for us. |
There's a discussion in #6551 about making the |
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. |
to reproduce:
aws_routetable
resource called "rt" and anaws_instance
resource called "inst"aws_route
resource pointing to theaws_routetable
resource, with aninstance_id
attribute of${aws_instance.inst.id}
terraform plan --out=tf.plan
terraform apply tf.plan
Repeat steps 3 and 4. Note that each time you repeat these steps, Terraform wants to change the
aws_route
resources by deleting thenetwork_instance_id
attributes.The text was updated successfully, but these errors were encountered: