-
Notifications
You must be signed in to change notification settings - Fork 9.4k
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/aws_route_table: Remove 'instance_id' target #14197
Comments
@ewbankkit Can we proceed with that breaking change? Or at least could we make |
@sylr I have added the deprecation of |
Are you saying that for the foreseeable future, anyone who needs to use AWS routes with network interfaces is bound to break |
Route tables routes can be defined with instance_id XOR network_interface_id and that is a problem because AWS returns both properties when routes are retrieved and thus it indefinitely generates a terraform diff. This change is supposed to happen in the v5.0.0 of the provider according to hashicorp#14197 (comment) Signed-off-by: Sylvain Rabot <sylvain@abstraction.fr>
Route table routes can be defined with instance_id XOR network_interface_id and that is a problem because AWS returns both properties when routes are retrieved and thus it indefinitely generates a terraform diff. This change is supposed to happen in the v5.0.0 of the provider according to hashicorp#14197 (comment) Signed-off-by: Sylvain Rabot <sylvain@abstraction.fr>
This functionality has been released in v5.0.0 of the Terraform AWS Provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading. For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template. Thank you! |
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. |
Community Note
Description
Relates: #5745.
Relates: #1426.
After a route is created that targets an EC2 instance (as Amazon recommend for NAT instances) via the
instance_id
attribute, reading back the route from the EC2 API also returns the ENI ID of the instance's primary network interface (network_interface_id
attribute). Similarly, after a route that targets an ENI attached to an instance (as Amazon recommend for middlebox applicances) via thenetwork_interface_id
attribute, reading back the route also returns the Instance ID of that ENI attachment (instance_id
attribute).For the
aws_route
resource this was addressed initially in hashicorp/terraform#5321 by setting the route target attributes toComputed: true
although then causes additional problems when updating the route, addressed in hashicorp/terraform#7686 and #14531. Even with these fixes the diff displayed by Terraform when changing a route target shows the updated routing having both old and new target attributes set.For the
aws_route_table
resource, where the individual routes are members of a set, the individual target attributes are not set asComputed: true
(although the enclosingroute
set is). This causes the additional attribute (network_interface_id
orinstance_id
not to be written to state and the eternal diff mentioned in #1426 occurs.If we mark
instance_id
andnetwork_interface_id
as bothComputed: true
in theroute
attribute's schema then we end up having to change the associated set hash function to choose one or other of those attributes to include in the hash and ignore the other - There is then no way to avoid continual diffs for one ofnetwork_interface_id
orinstance_id
.The long-term solution is to remove the
instance_id
attribute as a route target as the instance's primary ENI's ID can always be used in thenetwork_interface_id
attribute - This seems to be the preferred target according to the newer (middlebox appliance) documentation.The text was updated successfully, but these errors were encountered: