-
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
Unable to use network_interface_id within aws_route_table without incurring a diff everytime #1426
Comments
The workaround I had proposed won't always work if the instance has multiple interfaces. Received this error today:
|
Hey @rene00 thank you for the issue and the proposed fix. We'll take a look or perhaps a community member will take a try at it |
+1 Could it be possible to allow specifying both instance_id and network_interface_id when defining aws_route_table objects? Currently this behaviour fails during configuration check and, while I see a demand of consistency between the two IDs, AWS itself could give an error if the specified network interface is not attached to the relative instance. |
This occurs for me when providing instance_id (and not network_interface_id), too :( |
An aws_route_table using an instance as VPN occurred diff every time for me too using an network_interface_id in the route. resource "aws_route_table" "private" { resource "aws_route" "natgw" { resource "aws_route" "vpn" { |
I'm still seeing this with Terraform 0.11.14 and the latest AWS provider (2.11.0). My current workaround is to ignore route changes in a lifycycle block after initial creation. I can do this due to a somewhat static environment but it probably wont work for everyone. |
Terraform v0.12.3 and aws provider v2.17.0 and the problem persists. |
Still seeing this with Terraform v0.12.20 and the AWS Provider v2.48.0. |
…o_NetworkInterface_Attached' and 'TestAccAWSRouteTable_IPv4_To_NetworkInterface_TwoAttachments'. These two tests fail as expected (#1426 and hashicorp#5745).
…o_NetworkInterface_Attached' and 'TestAccAWSRouteTable_IPv4_To_NetworkInterface_TwoAttachments'. These two tests fail as expected (#1426 and hashicorp#5745).
…ion for future fixes/enhancements (#14013) * r/aws_route: New 'TestAccAWSRouteTable_basic'. Acceptance test output: $ make testacc TEST=./aws/ TESTARGS='-run=TestAccAWSRouteTable_basic' ==> Checking that code complies with gofmt requirements... TF_ACC=1 go test ./aws/ -v -count 1 -parallel 20 -run=TestAccAWSRouteTable_basic -timeout 120m === RUN TestAccAWSRouteTable_basic === PAUSE TestAccAWSRouteTable_basic === CONT TestAccAWSRouteTable_basic --- PASS: TestAccAWSRouteTable_basic (37.78s) PASS ok github.com/terraform-providers/terraform-provider-aws/aws 37.839s * r/aws_route: Add 'TestAccAWSRouteTable_disappears'. Acceptance test output: $ make testacc TEST=./aws/ TESTARGS='-run=TestAccAWSRouteTable_disappears' ==> Checking that code complies with gofmt requirements... TF_ACC=1 go test ./aws/ -v -count 1 -parallel 20 -run=TestAccAWSRouteTable_disappears -timeout 120m === RUN TestAccAWSRouteTable_disappears === PAUSE TestAccAWSRouteTable_disappears === CONT TestAccAWSRouteTable_disappears --- PASS: TestAccAWSRouteTable_disappears (35.58s) PASS ok github.com/terraform-providers/terraform-provider-aws/aws 35.625s * r/aws_route: Add 'TestAccAWSRouteTable_IPv4_To_InternetGateway'. Acceptance test output: $ make testacc TEST=./aws/ TESTARGS='-run=TestAccAWSRouteTable_IPv4_To_InternetGateway' ==> Checking that code complies with gofmt requirements... TF_ACC=1 go test ./aws/ -v -count 1 -parallel 20 -run=TestAccAWSRouteTable_IPv4_To_InternetGateway -timeout 120m === RUN TestAccAWSRouteTable_IPv4_To_InternetGateway === PAUSE TestAccAWSRouteTable_IPv4_To_InternetGateway === CONT TestAccAWSRouteTable_IPv4_To_InternetGateway --- PASS: TestAccAWSRouteTable_IPv4_To_InternetGateway (78.31s) PASS ok github.com/terraform-providers/terraform-provider-aws/aws 78.372s * r/aws_route: Update 'TestAccAWSRouteTable_tags'. Acceptance test output: $ make testacc TEST=./aws/ TESTARGS='-run=TestAccAWSRouteTable_tags' ==> Checking that code complies with gofmt requirements... TF_ACC=1 go test ./aws/ -v -count 1 -parallel 20 -run=TestAccAWSRouteTable_tags -timeout 120m === RUN TestAccAWSRouteTable_tags === PAUSE TestAccAWSRouteTable_tags === CONT TestAccAWSRouteTable_tags --- PASS: TestAccAWSRouteTable_tags (84.18s) PASS ok github.com/terraform-providers/terraform-provider-aws/aws 84.234s * r/aws_route_table: 'TestAccAWSRouteTable_instance' -> 'TestAccAWSRouteTable_IPv4_To_Instance'. Acceptance test output: $ make testacc TEST=./aws/ TESTARGS='-run=TestAccAWSRouteTable_IPv4_To_Instance' ==> Checking that code complies with gofmt requirements... TF_ACC=1 go test ./aws/ -v -count 1 -parallel 20 -run=TestAccAWSRouteTable_IPv4_To_Instance -timeout 120m === RUN TestAccAWSRouteTable_IPv4_To_Instance === PAUSE TestAccAWSRouteTable_IPv4_To_Instance === CONT TestAccAWSRouteTable_IPv4_To_Instance --- PASS: TestAccAWSRouteTable_IPv4_To_Instance (109.73s) PASS ok github.com/terraform-providers/terraform-provider-aws/aws 109.799s * r/aws_route_table: 'TestAccAWSRouteTable_ipv6' -> 'TestAccAWSRouteTable_IPv6_To_EgressOnlyInternetGateway'. Acceptance test output: $ make testacc TEST=./aws/ TESTARGS='-run=TestAccAWSRouteTable_IPv6_To_EgressOnlyInternetGateway' ==> Checking that code complies with gofmt requirements... TF_ACC=1 go test ./aws/ -v -count 1 -parallel 20 -run=TestAccAWSRouteTable_IPv6_To_EgressOnlyInternetGateway -timeout 120m === RUN TestAccAWSRouteTable_IPv6_To_EgressOnlyInternetGateway === PAUSE TestAccAWSRouteTable_IPv6_To_EgressOnlyInternetGateway === CONT TestAccAWSRouteTable_IPv6_To_EgressOnlyInternetGateway --- PASS: TestAccAWSRouteTable_IPv6_To_EgressOnlyInternetGateway (41.79s) PASS ok github.com/terraform-providers/terraform-provider-aws/aws 41.826s * r/aws_route_table: Fix 'testAccRouteTableConfigPanicEmptyRoute'. Acceptance test output: $ make testacc TEST=./aws/ TESTARGS='-run=TestAccAWSRouteTable_panicEmptyRoute' ==> Checking that code complies with gofmt requirements... TF_ACC=1 go test ./aws/ -v -count 1 -parallel 20 -run=TestAccAWSRouteTable_panicEmptyRoute -timeout 120m === RUN TestAccAWSRouteTable_panicEmptyRoute === PAUSE TestAccAWSRouteTable_panicEmptyRoute === CONT TestAccAWSRouteTable_panicEmptyRoute --- PASS: TestAccAWSRouteTable_panicEmptyRoute (24.60s) PASS ok github.com/terraform-providers/terraform-provider-aws/aws 24.636s * r/aws_route_table: Rework 'TestAccAWSRouteTable_Route_ConfigMode'. Acceptance test output: $ make testacc TEST=./aws/ TESTARGS='-run=TestAccAWSRouteTable_Route_ConfigMode' ==> Checking that code complies with gofmt requirements... TF_ACC=1 go test ./aws/ -v -count 1 -parallel 20 -run=TestAccAWSRouteTable_Route_ConfigMode -timeout 120m === RUN TestAccAWSRouteTable_Route_ConfigMode === PAUSE TestAccAWSRouteTable_Route_ConfigMode === CONT TestAccAWSRouteTable_Route_ConfigMode --- PASS: TestAccAWSRouteTable_Route_ConfigMode (102.67s) PASS ok github.com/terraform-providers/terraform-provider-aws/aws 102.732s * r/aws_route_table: 'TestAccAWSRouteTable_Route_TransitGatewayID' -> 'TestAccAWSRouteTable_IPv4_To_TransitGateway'. Acceptance test output: $ make testacc TEST=./aws/ TESTARGS='-run=TestAccAWSRouteTable_IPv4_To_TransitGateway' ==> Checking that code complies with gofmt requirements... TF_ACC=1 go test ./aws/ -v -count 1 -parallel 20 -run=TestAccAWSRouteTable_IPv4_To_TransitGateway -timeout 120m === RUN TestAccAWSRouteTable_IPv4_To_TransitGateway === PAUSE TestAccAWSRouteTable_IPv4_To_TransitGateway === CONT TestAccAWSRouteTable_IPv4_To_TransitGateway --- PASS: TestAccAWSRouteTable_IPv4_To_TransitGateway (338.85s) PASS ok github.com/terraform-providers/terraform-provider-aws/aws 338.907s * r/aws_route_table: 'TestAccAWSRouteTable_vpcPeering' -> 'TestAccAWSRouteTable_IPv4_To_VpcPeeringConnection'. Acceptance test output: $ make testacc TEST=./aws/ TESTARGS='-run=TestAccAWSRouteTable_IPv4_To_VpcPeeringConnection' ==> Checking that code complies with gofmt requirements... TF_ACC=1 go test ./aws/ -v -count 1 -parallel 20 -run=TestAccAWSRouteTable_IPv4_To_VpcPeeringConnection -timeout 120m === RUN TestAccAWSRouteTable_IPv4_To_VpcPeeringConnection === PAUSE TestAccAWSRouteTable_IPv4_To_VpcPeeringConnection === CONT TestAccAWSRouteTable_IPv4_To_VpcPeeringConnection --- PASS: TestAccAWSRouteTable_IPv4_To_VpcPeeringConnection (43.87s) PASS ok github.com/terraform-providers/terraform-provider-aws/aws 43.905s * r/aws_route_table: Rework 'TestAccAWSRouteTable_vgwRoutePropagation'. Acceptance test output: $ make testacc TEST=./aws/ TESTARGS='-run=TestAccAWSRouteTable_vgwRoutePropagation' ==> Checking that code complies with gofmt requirements... TF_ACC=1 go test ./aws/ -v -count 1 -parallel 20 -run=TestAccAWSRouteTable_vgwRoutePropagation -timeout 120m === RUN TestAccAWSRouteTable_vgwRoutePropagation === PAUSE TestAccAWSRouteTable_vgwRoutePropagation === CONT TestAccAWSRouteTable_vgwRoutePropagation --- PASS: TestAccAWSRouteTable_vgwRoutePropagation (112.21s) PASS ok github.com/terraform-providers/terraform-provider-aws/aws 112.290s * r/aws_route_table: Add 'TestAccAWSRouteTable_VpcMultipleCidrs_VpcEndpointAssociation'. Currently fails. Acceptance test output: $ make testacc TEST=./aws/ TESTARGS='-run=TestAccAWSRouteTable_VpcMultipleCidrs_VpcEndpointAssociation' ==> Checking that code complies with gofmt requirements... TF_ACC=1 go test ./aws/ -v -count 1 -parallel 20 -run=TestAccAWSRouteTable_VpcMultipleCidrs_VpcEndpointAssociation -timeout 120m === RUN TestAccAWSRouteTable_VpcMultipleCidrs_VpcEndpointAssociation === PAUSE TestAccAWSRouteTable_VpcMultipleCidrs_VpcEndpointAssociation === CONT TestAccAWSRouteTable_VpcMultipleCidrs_VpcEndpointAssociation --- FAIL: TestAccAWSRouteTable_VpcMultipleCidrs_VpcEndpointAssociation (47.64s) testing.go:684: Step 0 error: Check failed: Check 2/7 error: Route Table has incorrect number of routes (Expected=3, Actual=2) FAIL FAIL github.com/terraform-providers/terraform-provider-aws/aws 47.694s FAIL GNUmakefile:26: recipe for target 'testacc' failed make: *** [testacc] Error 1 * Comment out 'TestAccAWSRouteTable_VpcMultipleCidrs_VpcEndpointAssociation'. * r/aws_route_table: Add 'TestAccAWSRouteTable_IPv4_To_NatGateway'. Acceptance test output: $ make testacc TEST=./aws/ TESTARGS='-run=TestAccAWSRouteTable_IPv4_To_NatGateway' ==> Checking that code complies with gofmt requirements... TF_ACC=1 go test ./aws/ -v -count 1 -parallel 20 -run=TestAccAWSRouteTable_IPv4_To_NatGateway -timeout 120m === RUN TestAccAWSRouteTable_IPv4_To_NatGateway === PAUSE TestAccAWSRouteTable_IPv4_To_NatGateway === CONT TestAccAWSRouteTable_IPv4_To_NatGateway --- PASS: TestAccAWSRouteTable_IPv4_To_NatGateway (228.80s) PASS ok github.com/terraform-providers/terraform-provider-aws/aws 228.838s * r/aws_route_table: Add 'TestAccAWSRouteTable_IPv6_To_NetworkInterface'. Acceptance test output: $ make testacc TEST=./aws/ TESTARGS='-run=TestAccAWSRouteTable_IPv6_To_NetworkInterface' ==> Checking that code complies with gofmt requirements... TF_ACC=1 go test ./aws/ -v -count 1 -parallel 20 -run=TestAccAWSRouteTable_IPv6_To_NetworkInterface -timeout 120m === RUN TestAccAWSRouteTable_IPv6_To_NetworkInterface === PAUSE TestAccAWSRouteTable_IPv6_To_NetworkInterface === CONT TestAccAWSRouteTable_IPv6_To_NetworkInterface --- PASS: TestAccAWSRouteTable_IPv6_To_NetworkInterface (48.88s) PASS ok github.com/terraform-providers/terraform-provider-aws/aws 48.917s * r/aws_route_table: Rework 'TestAccAWSRouteTable_ConditionalCidrBlock'. Acceptance test output: $ make testacc TEST=./aws/ TESTARGS='-run=TestAccAWSRouteTable_ConditionalCidrBlock' ==> Checking that code complies with gofmt requirements... TF_ACC=1 go test ./aws/ -v -count 1 -parallel 20 -run=TestAccAWSRouteTable_ConditionalCidrBlock -timeout 120m === RUN TestAccAWSRouteTable_ConditionalCidrBlock === PAUSE TestAccAWSRouteTable_ConditionalCidrBlock === CONT TestAccAWSRouteTable_ConditionalCidrBlock --- PASS: TestAccAWSRouteTable_ConditionalCidrBlock (78.76s) PASS ok github.com/terraform-providers/terraform-provider-aws/aws 78.837s * r/aws_route_table: Rework 'testAccCheckAWSRouteTablePropagatingVgw'. Acceptance test output: $ make testacc TEST=./aws/ TESTARGS='-run=TestAccAWSRouteTable_vgwRoutePropagation' ==> Checking that code complies with gofmt requirements... TF_ACC=1 go test ./aws/ -v -count 1 -parallel 20 -run=TestAccAWSRouteTable_vgwRoutePropagation -timeout 120m === RUN TestAccAWSRouteTable_vgwRoutePropagation === PAUSE TestAccAWSRouteTable_vgwRoutePropagation === CONT TestAccAWSRouteTable_vgwRoutePropagation --- PASS: TestAccAWSRouteTable_vgwRoutePropagation (115.39s) PASS ok github.com/terraform-providers/terraform-provider-aws/aws 115.474s * Acceptance test output: $ make testacc TEST=./aws/ TESTARGS='-run=TestAccAWSRouteTable_' ==> Checking that code complies with gofmt requirements... TF_ACC=1 go test ./aws/ -v -count 1 -parallel 2 -run=TestAccAWSRouteTable_ -timeout 120m === RUN TestAccAWSRouteTable_basic === PAUSE TestAccAWSRouteTable_basic === RUN TestAccAWSRouteTable_disappears === PAUSE TestAccAWSRouteTable_disappears === RUN TestAccAWSRouteTable_IPv4_To_InternetGateway === PAUSE TestAccAWSRouteTable_IPv4_To_InternetGateway === RUN TestAccAWSRouteTable_IPv4_To_Instance === PAUSE TestAccAWSRouteTable_IPv4_To_Instance === RUN TestAccAWSRouteTable_IPv6_To_EgressOnlyInternetGateway === PAUSE TestAccAWSRouteTable_IPv6_To_EgressOnlyInternetGateway === RUN TestAccAWSRouteTable_tags === PAUSE TestAccAWSRouteTable_tags === RUN TestAccAWSRouteTable_panicEmptyRoute === PAUSE TestAccAWSRouteTable_panicEmptyRoute === RUN TestAccAWSRouteTable_Route_ConfigMode === PAUSE TestAccAWSRouteTable_Route_ConfigMode === RUN TestAccAWSRouteTable_IPv4_To_TransitGateway === PAUSE TestAccAWSRouteTable_IPv4_To_TransitGateway === RUN TestAccAWSRouteTable_IPv4_To_VpcPeeringConnection === PAUSE TestAccAWSRouteTable_IPv4_To_VpcPeeringConnection === RUN TestAccAWSRouteTable_vgwRoutePropagation === PAUSE TestAccAWSRouteTable_vgwRoutePropagation === RUN TestAccAWSRouteTable_ConditionalCidrBlock === PAUSE TestAccAWSRouteTable_ConditionalCidrBlock === RUN TestAccAWSRouteTable_IPv4_To_NatGateway === PAUSE TestAccAWSRouteTable_IPv4_To_NatGateway === RUN TestAccAWSRouteTable_IPv6_To_NetworkInterface === PAUSE TestAccAWSRouteTable_IPv6_To_NetworkInterface === CONT TestAccAWSRouteTable_basic === CONT TestAccAWSRouteTable_IPv4_To_TransitGateway --- PASS: TestAccAWSRouteTable_basic (37.06s) === CONT TestAccAWSRouteTable_IPv6_To_NetworkInterface --- PASS: TestAccAWSRouteTable_IPv6_To_NetworkInterface (47.79s) === CONT TestAccAWSRouteTable_IPv4_To_NatGateway --- PASS: TestAccAWSRouteTable_IPv4_To_NatGateway (196.98s) === CONT TestAccAWSRouteTable_ConditionalCidrBlock --- PASS: TestAccAWSRouteTable_IPv4_To_TransitGateway (348.59s) === CONT TestAccAWSRouteTable_vgwRoutePropagation --- PASS: TestAccAWSRouteTable_ConditionalCidrBlock (77.19s) === CONT TestAccAWSRouteTable_IPv4_To_VpcPeeringConnection --- PASS: TestAccAWSRouteTable_IPv4_To_VpcPeeringConnection (44.68s) === CONT TestAccAWSRouteTable_IPv6_To_EgressOnlyInternetGateway --- PASS: TestAccAWSRouteTable_IPv6_To_EgressOnlyInternetGateway (42.42s) === CONT TestAccAWSRouteTable_Route_ConfigMode --- PASS: TestAccAWSRouteTable_vgwRoutePropagation (115.86s) === CONT TestAccAWSRouteTable_panicEmptyRoute --- PASS: TestAccAWSRouteTable_panicEmptyRoute (24.55s) === CONT TestAccAWSRouteTable_tags --- PASS: TestAccAWSRouteTable_Route_ConfigMode (101.57s) === CONT TestAccAWSRouteTable_IPv4_To_InternetGateway --- PASS: TestAccAWSRouteTable_tags (83.12s) === CONT TestAccAWSRouteTable_IPv4_To_Instance --- PASS: TestAccAWSRouteTable_IPv4_To_InternetGateway (78.17s) === CONT TestAccAWSRouteTable_disappears --- PASS: TestAccAWSRouteTable_disappears (34.81s) --- PASS: TestAccAWSRouteTable_IPv4_To_Instance (121.04s) PASS ok github.com/terraform-providers/terraform-provider-aws/aws 693.250s * r/aws_route_table: Add (and comment out) 'TestAccAWSRouteTable_IPv4_To_NetworkInterface_Attached' and 'TestAccAWSRouteTable_IPv4_To_NetworkInterface_TwoAttachments'. These two tests fail as expected (#1426 and #5745). * r/aws_route_table: Add 'testAccCheckAWSRouteTableRoute'. * r/aws_route_table: Rename 'TestAccAWSRouteTable_VpcMultipleCidrs_VpcEndpointAssociation' to 'TestAccAWSRouteTable_VpcMultipleCidrs'. Gateway VPC Endpoint routes are added asynchronously so don't attempt to test. Acceptance test output: $ make testacc TEST=./aws/ TESTARGS='-run=TestAccAWSRouteTable_VpcMultipleCidrs' ==> Checking that code complies with gofmt requirements... TF_ACC=1 go test ./aws/ -v -count 1 -parallel 20 -run=TestAccAWSRouteTable_VpcMultipleCidrs -timeout 120m === RUN TestAccAWSRouteTable_VpcMultipleCidrs === PAUSE TestAccAWSRouteTable_VpcMultipleCidrs === CONT TestAccAWSRouteTable_VpcMultipleCidrs --- PASS: TestAccAWSRouteTable_VpcMultipleCidrs (62.16s) PASS ok github.com/terraform-providers/terraform-provider-aws/aws 62.213s * r/aws_route_table: Add 'TestAccAWSRouteTable_VpcClassicLink' Acceptance test output: $ make testacc TEST=./aws/ TESTARGS='-run=TestAccAWSRouteTable_VpcClassicLink' ==> Checking that code complies with gofmt requirements... TF_ACC=1 go test ./aws/ -v -count 1 -parallel 20 -run=TestAccAWSRouteTable_VpcClassicLink -timeout 120m === RUN TestAccAWSRouteTable_VpcClassicLink === PAUSE TestAccAWSRouteTable_VpcClassicLink === CONT TestAccAWSRouteTable_VpcClassicLink --- PASS: TestAccAWSRouteTable_VpcClassicLink (38.84s) PASS ok github.com/terraform-providers/terraform-provider-aws/aws 38.888s * r/aws_route_table: Add 'TestAccAWSRouteTable_GatewayVpcEndpoint' Acceptance test output: $ make testacc TEST=./aws/ TESTARGS='-run=TestAccAWSRouteTable_GatewayVpcEndpoint' ==> Checking that code complies with gofmt requirements... TF_ACC=1 go test ./aws/ -v -count 1 -parallel 20 -run=TestAccAWSRouteTable_GatewayVpcEndpoint -timeout 120m === RUN TestAccAWSRouteTable_GatewayVpcEndpoint === PAUSE TestAccAWSRouteTable_GatewayVpcEndpoint === CONT TestAccAWSRouteTable_GatewayVpcEndpoint --- PASS: TestAccAWSRouteTable_GatewayVpcEndpoint (210.60s) PASS ok github.com/terraform-providers/terraform-provider-aws/aws 210.650s * r/aws_route_table: Add 'TestAccAWSRouteTable_disappears_SubnetAssociation'. Acceptance test output: $ make testacc TEST=./aws/ TESTARGS='-run=TestAccAWSRouteTable_disappears_SubnetAssociation' ==> Checking that code complies with gofmt requirements... TF_ACC=1 go test ./aws/ -v -count 1 -parallel 20 -run=TestAccAWSRouteTable_disappears_SubnetAssociation -timeout 120m === RUN TestAccAWSRouteTable_disappears_SubnetAssociation === PAUSE TestAccAWSRouteTable_disappears_SubnetAssociation === CONT TestAccAWSRouteTable_disappears_SubnetAssociation --- PASS: TestAccAWSRouteTable_disappears_SubnetAssociation (44.11s) PASS ok github.com/terraform-providers/terraform-provider-aws/aws 44.160s * r/aws_route_table: Add 'TestAccAWSRouteTable_MultipleRoutes'. Acceptance test output: $ make testacc TEST=./aws/ TESTARGS='-run=TestAccAWSRouteTable_MultipleRoutes' ==> Checking that code complies with gofmt requirements... TF_ACC=1 go test ./aws/ -v -count 1 -parallel 20 -run=TestAccAWSRouteTable_MultipleRoutes -timeout 120m === RUN TestAccAWSRouteTable_MultipleRoutes === PAUSE TestAccAWSRouteTable_MultipleRoutes === CONT TestAccAWSRouteTable_MultipleRoutes --- PASS: TestAccAWSRouteTable_MultipleRoutes (191.08s) PASS ok github.com/terraform-providers/terraform-provider-aws/aws 191.139s * r/aws_route_table: Use Amazon NAT instance AMI for instance tests. Acceptance test output: $ make testacc TEST=./aws/ TESTARGS='-run=TestAccAWSRouteTable_IPv4_To_Instance' ==> Checking that code complies with gofmt requirements... TF_ACC=1 go test ./aws/ -v -count 1 -parallel 20 -run=TestAccAWSRouteTable_IPv4_To_Instance -timeout 120m === RUN TestAccAWSRouteTable_IPv4_To_Instance === PAUSE TestAccAWSRouteTable_IPv4_To_Instance === CONT TestAccAWSRouteTable_IPv4_To_Instance --- PASS: TestAccAWSRouteTable_IPv4_To_Instance (109.91s) PASS ok github.com/terraform-providers/terraform-provider-aws/aws 110.478s $ make testacc TEST=./aws/ TESTARGS='-run=TestAccAWSRouteTable_MultipleRoutes' ==> Checking that code complies with gofmt requirements... TF_ACC=1 go test ./aws/ -v -count 1 -parallel 20 -run=TestAccAWSRouteTable_MultipleRoutes -timeout 120m === RUN TestAccAWSRouteTable_MultipleRoutes === PAUSE TestAccAWSRouteTable_MultipleRoutes === CONT TestAccAWSRouteTable_MultipleRoutes --- PASS: TestAccAWSRouteTable_MultipleRoutes (204.15s) PASS ok github.com/terraform-providers/terraform-provider-aws/aws 204.201s * r/aws_route_table: Delete 'TestAccAWSRouteTable_IPv4_To_NetworkInterface_Attached' and 'TestAccAWSRouteTable_IPv4_To_NetworkInterface_TwoAttachments'. If we mark `instance_id` and `network_interface_id` as both `Computed: true` in the `route` 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. This means that either 'TestAccAWSRouteTable_IPv4_To_Instance' will show continuous diffs or 'TestAccAWSRouteTable_IPv4_To_NetworkInterface_Attached' will. The longer term solution is to remove `instance_id` as a route target as the instance's primary ENI's ID can be used in the `network_interface_id`. This will also simplify the `aws_route` resource. * r/aws_route_table: Use 'testAccAvailableAZsNoOptInExcludeConfig'. * Use 'testAccAvailableAZsNoOptInDefaultExcludeConfig'. * Fix compilation errors after rebase. * Fix compilation errors after rebase. * Exclude 'resource_aws_route_table_test.go' from acceptance test Terraform linting (testAccAWSRouteTableConfigMultipleRoutes). * r/aws_route_table: Ensure no diff when expanded form of IPv6 CIDR block is used. Acceptance test output: $ make testacc TEST=./aws/ TESTARGS='-run=TestAccAWSRouteTable_IPv6_To_EgressOnlyInternetGateway' ==> Checking that code complies with gofmt requirements... TF_ACC=1 go test ./aws/ -v -count 1 -parallel 20 -run=TestAccAWSRouteTable_IPv6_To_EgressOnlyInternetGateway -timeout 120m === RUN TestAccAWSRouteTable_IPv6_To_EgressOnlyInternetGateway === PAUSE TestAccAWSRouteTable_IPv6_To_EgressOnlyInternetGateway === CONT TestAccAWSRouteTable_IPv6_To_EgressOnlyInternetGateway --- PASS: TestAccAWSRouteTable_IPv6_To_EgressOnlyInternetGateway (60.43s) PASS ok github.com/terraform-providers/terraform-provider-aws/aws 60.474s * r/aws_vpc_endpoint_route_table_association: Rename 'TestAccAWSRouteTable_Route_VpcEndpointId' to 'TestAccAWSRouteTable_IPv4_To_VpcEndpoint'. Acceptance test output: $ make testacc TEST=./aws/ TESTARGS='-run=TestAccAWSRouteTable_IPv4_To_VpcEndpoint' ACCTEST_PARALLELISM=2 ==> Checking that code complies with gofmt requirements... TF_ACC=1 go test ./aws -v -count 1 -parallel 2 -run=TestAccAWSRouteTable_IPv4_To_VpcEndpoint -timeout 120m === RUN TestAccAWSRouteTable_IPv4_To_VpcEndpoint === PAUSE TestAccAWSRouteTable_IPv4_To_VpcEndpoint === CONT TestAccAWSRouteTable_IPv4_To_VpcEndpoint --- PASS: TestAccAWSRouteTable_IPv4_To_VpcEndpoint (410.02s) PASS ok github.com/terraform-providers/terraform-provider-aws/aws 410.081s * r/aws_route_table: Missing commit from rebase. * Update aws/resource_aws_route_table_test.go Co-authored-by: Brian Flad <bflad417@gmail.com> * Update aws/resource_aws_route_table_test.go Co-authored-by: Brian Flad <bflad417@gmail.com> * Update aws/resource_aws_route_table_test.go Co-authored-by: Brian Flad <bflad417@gmail.com> * Update aws/resource_aws_route_table_test.go Co-authored-by: Brian Flad <bflad417@gmail.com> * Update aws/resource_aws_route_table_test.go Co-authored-by: Brian Flad <bflad417@gmail.com> * r/aws_route_table: 'make fmt'. * r/aws_route_table: Refactor 'TestAccAWSRouteTable_MultipleRoutes' so as to avoid dynamic attribute names. Acceptance test output: $ make testacc TEST=./aws/ TESTARGS='-run=TestAccAWSRouteTable_MultipleRoutes' ==> Checking that code complies with gofmt requirements... TF_ACC=1 go test ./aws -v -count 1 -parallel 20 -run=TestAccAWSRouteTable_MultipleRoutes -timeout 120m === RUN TestAccAWSRouteTable_MultipleRoutes === PAUSE TestAccAWSRouteTable_MultipleRoutes === CONT TestAccAWSRouteTable_MultipleRoutes --- PASS: TestAccAWSRouteTable_MultipleRoutes (165.99s) PASS ok github.com/terraform-providers/terraform-provider-aws/aws 166.047s * Fix 'terrafmt' issues. Co-authored-by: Brian Flad <bflad417@gmail.com>
Since I've encountered this issue myself (which I deem critical in my setup) I've taken it upon myself to implement #14197, build and publish it on the terraform registry. So for those in need of a fix for this issue you can use sylr/aws. The source code can be found at https://github.com/sylr/terraform-provider-aws/tree/v3.71.0-sylr.1. |
Still getting a perpetual diff with Terraform 1.2.1 and AWS Provider 4.24.0 |
Still getting this on Terraform 1.2.8 and AWS Provider 4.11.0 Can we get rid of the warning saying to use network_interface_id instead of instance_id? network_interface_id doesn't seem to be a sensible option right now. |
Still get this error on Terraform 1.2.9 and AWS Provider 4.31.0. Agree with @unixtastic - the warning is annoying, but using |
Still get the error on: terraform --version
Terraform v1.3.7
on darwin_amd64
+ provider registry.terraform.io/hashicorp/aws v4.49.0 My code basicaly: resource "aws_eip" "nat_gateway_ip" {
vpc = true
tags = {
Name = "Public IP to Privnet"
}
}
resource "aws_nat_gateway" "nat_gateway" {
allocation_id = aws_eip.nat_gateway_ip.id
subnet_id = aws_subnet.dmz.id
tags = {
Name = "Private network nat gateway"
Description = "NAT gateway 4 private instances"
}
}
resource "aws_route_table" "internal" {
vpc_id = aws_vpc.lab.id
route {
cidr_block = "0.0.0.0/0"
gateway_id = aws_nat_gateway.nat_gateway.id
}
tags = {
Name = "Internal route table"
}
}
resource "aws_route_table_association" "private_subnets" {
# List of subnets created w/ count
for_each = { for k, subnet in aws_subnet.private : k => subnet }
subnet_id = each.value.id
route_table_id = aws_route_table.internal.id
} And every Actual Behaviour Every time I exec plan || apply, there are modifications. Terraform used the selected providers to generate the following execution plan. Resource actions are indicated with the following symbols:
~ update in-place
Terraform will perform the following actions:
# aws_route_table.internal will be updated in-place
~ resource "aws_route_table" "internal" {
id = "rtb-085553f49104ea7f9"
~ route = [
- {
- carrier_gateway_id = ""
- cidr_block = "0.0.0.0/0"
- core_network_arn = ""
- destination_prefix_list_id = ""
- egress_only_gateway_id = ""
- gateway_id = ""
- instance_id = ""
- ipv6_cidr_block = ""
- local_gateway_id = ""
- nat_gateway_id = "nat-0f5a04ec428f6e340"
- network_interface_id = ""
- transit_gateway_id = ""
- vpc_endpoint_id = ""
- vpc_peering_connection_id = ""
},
+ {
+ carrier_gateway_id = ""
+ cidr_block = "0.0.0.0/0"
+ core_network_arn = ""
+ destination_prefix_list_id = ""
+ egress_only_gateway_id = ""
+ gateway_id = "nat-0f5a04ec428f6e340"
+ instance_id = ""
+ ipv6_cidr_block = ""
+ local_gateway_id = ""
+ nat_gateway_id = ""
+ network_interface_id = ""
+ transit_gateway_id = ""
+ vpc_endpoint_id = ""
+ vpc_peering_connection_id = ""
},
]
tags = {
"Name" = "Tabela de rotas interna"
}
# (5 unchanged attributes hidden)
}
Plan: 0 to add, 1 to change, 0 to destroy. Expected behaviour No changes |
@paulopatto Looks like you might be seeing that behavior for a different reason: gateway_id vs. nat_gateway_id.
In the route config, try changing gateway_id to nat_gateway_id:
|
$> terraform --version
This issue is very frustrating when route tables get extensive. Finding what's actually changing in the output of 'terraform plan' is very time consuming. Some mention of this issue should be included in the AWS module documentation page for "Resource: aws_route_table", instead all we have is a recommendation to use network_interface_id instead of instance_id. |
Is it possible to add a warning to the aws_route_table documentation recommending against the use of in-line routes? This should not be left as an undocumented trap for future users. |
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. |
Terraform Version
Affected Resource(s)
Terraform Configuration Files
Expected Behavior
Running
terraform apply
for the second time there should be no modifications.Actual Behavior
Running
terraform apply
for the second time there are modifications.Steps to Reproduce
Please list the steps required to reproduce the issue, for example:
terraform apply
terraform apply
again.Important Factoids
network_interface_id
orinstance_id
can be set for routes withinaws_route_table
though when settingnetwork_interface_id
it appears AWS sends backinstance_id
ANDnetwork_interface_id
which triggers a diff.This looks like it was fixed for standalone routes with
aws_route
but not in-line routes withinaws_route_table
.Work around for now is to replace
network_interface_id
withinstance_id
.References
The text was updated successfully, but these errors were encountered: