hashicorp / terraform-provider-aws

The AWS Provider enables Terraform to manage AWS resources.
https://registry.terraform.io/providers/hashicorp/aws
Mozilla Public License 2.0
9.77k stars 9.12k forks source link

Bug when routing table routing is added #20259

Open systemJine opened 3 years ago

systemJine commented 3 years ago

Hello When attempting to add routing in a routing table, it appears that you want to clear and add existing routing. It is assumed that a -+ symptom occurs during the ascending routing sort process. Is there a solution?

Thank you

ewbankkit commented 3 years ago

@systemJine Thanks for raising this issue. Can you paste the output from terraform plan so that we will have details on the behavior you are seeing?

systemJine commented 3 years ago

@ewbankkit I have information, so I'll change some values ​​and share. I added only the 10.12.0.0/16 band, but it seems to be created after deleting all of them as shown below terraform version Terraform v0.15.2

# module.route_table["private"].aws_route_table.route_table will be updated in-place
  ~ resource "aws_route_table" "route_table" {
        id               = "rtb-xxxxxxxxx"
      ~ route            = [
          - {
              - carrier_gateway_id         = ""
              - cidr_block                 = "0.0.0.0/0"
              - destination_prefix_list_id = ""
              - egress_only_gateway_id     = ""
              - gateway_id                 = ""
              - instance_id                = ""
              - ipv6_cidr_block            = ""
              - local_gateway_id           = ""
              - nat_gateway_id             = "nat-xxxxxxxx"
              - network_interface_id       = ""
              - transit_gateway_id         = ""
              - vpc_endpoint_id            = ""
              - vpc_peering_connection_id  = ""
            },
          - {
              - carrier_gateway_id         = ""
              - cidr_block                 = "10.0.0.0/8"
              - destination_prefix_list_id = ""
              - egress_only_gateway_id     = ""
              - gateway_id                 = ""
              - instance_id                = ""
              - ipv6_cidr_block            = ""
              - local_gateway_id           = ""
              - nat_gateway_id             = ""
              - network_interface_id       = ""
              - transit_gateway_id         = "tgw-xxxxxxxx"
              - vpc_endpoint_id            = ""
              - vpc_peering_connection_id  = ""
            },
          + {
              + carrier_gateway_id         = ""
              + cidr_block                 = "10.12.0.0/16"
              + destination_prefix_list_id = ""
              + egress_only_gateway_id     = ""
              + gateway_id                 = ""
              + instance_id                = ""
              + ipv6_cidr_block            = ""
              + local_gateway_id           = ""
              + nat_gateway_id             = ""
              + network_interface_id       = ""
              + transit_gateway_id         = "tgw-xxxxxxxx"
              + vpc_endpoint_id            = ""
              + vpc_peering_connection_id  = ""
            },
          - {
              - carrier_gateway_id         = ""
              - cidr_block                 = "172.0.0.0/8"
              - destination_prefix_list_id = ""
              - egress_only_gateway_id     = ""
              - gateway_id                 = ""
              - instance_id                = ""
              - ipv6_cidr_block            = ""
              - local_gateway_id           = ""
              - nat_gateway_id             = ""
              - network_interface_id       = ""
              - transit_gateway_id         = "tgw-xxxxxxxx"
              - vpc_endpoint_id            = ""
              - vpc_peering_connection_id  = ""
            },
          - {
              - carrier_gateway_id         = ""
              - cidr_block                 = "192.168.0.0/16"
              - destination_prefix_list_id = ""
              - egress_only_gateway_id     = ""
              - gateway_id                 = ""
              - instance_id                = ""
              - ipv6_cidr_block            = ""
              - local_gateway_id           = ""
              - nat_gateway_id             = ""
              - network_interface_id       = ""
              - transit_gateway_id         = "tgw-xxxxxxxxx"
              - vpc_endpoint_id            = ""
              - vpc_peering_connection_id  = ""
            },
          + {
              + carrier_gateway_id         = null
              + cidr_block                 = "0.0.0.0/0"
              + destination_prefix_list_id = null
              + egress_only_gateway_id     = null
              + gateway_id                 = null
              + instance_id                = null
              + ipv6_cidr_block            = null
              + local_gateway_id           = null
              + nat_gateway_id             = "nat-xxxxxxxxx"
              + network_interface_id       = null
              + transit_gateway_id         = null
              + vpc_endpoint_id            = null
              + vpc_peering_connection_id  = null
            },
          + {
              + carrier_gateway_id         = null
              + cidr_block                 = "10.0.0.0/8"
              + destination_prefix_list_id = null
              + egress_only_gateway_id     = null
              + gateway_id                 = null
              + instance_id                = null
              + ipv6_cidr_block            = null
              + local_gateway_id           = null
              + nat_gateway_id             = null
              + network_interface_id       = null
              + transit_gateway_id         = "tgw-xxxxxxxx"
              + vpc_endpoint_id            = null
              + vpc_peering_connection_id  = null
            },
          + {
              + carrier_gateway_id         = null
              + cidr_block                 = "172.0.0.0/8"
              + destination_prefix_list_id = null
              + egress_only_gateway_id     = null
              + gateway_id                 = null
              + instance_id                = null
              + ipv6_cidr_block            = null
              + local_gateway_id           = null
              + nat_gateway_id             = null
              + network_interface_id       = null
              + transit_gateway_id         = "tgw-xxxxxxxxxxx"
              + vpc_endpoint_id            = null
              + vpc_peering_connection_id  = null
            },
          + {
              + carrier_gateway_id         = null
              + cidr_block                 = "192.168.0.0/16"
              + destination_prefix_list_id = null
              + egress_only_gateway_id     = null
              + gateway_id                 = null
              + instance_id                = null
              + ipv6_cidr_block            = null
              + local_gateway_id           = null
              + nat_gateway_id             = null
              + network_interface_id       = null
              + transit_gateway_id         = "tgw-xxxxxxxxxxx"
              + vpc_endpoint_id            = null
              + vpc_peering_connection_id  = null
            },
        ]
systemJine commented 3 years ago

@systemJine Thanks for raising this issue. Can you paste the output from terraform plan so that we will have details on the behavior you are seeing?

systemJine commented 3 years ago

@ewbankkit How long will it take to check?

rumititim commented 2 years ago

Hello, today we've got a similar issue - routes were being removed and created, but we didn't add/remove any route tables. The change has been done on different resource (aws_lb_listener_rule) in the same tf state. Our terrafrom version is 0.14.11. terraform plan:

~ resource "aws_route_table" "SNT" {
    id               = "rtb-0xxxxxxxxxxxxxa6"
  ~ route            = [
      - {
          - carrier_gateway_id         = ""
          - cidr_block                 = "10.0.0.0/8"
          - destination_prefix_list_id = ""
          - egress_only_gateway_id     = ""
          - gateway_id                 = ""
          - instance_id                = ""
          - ipv6_cidr_block            = ""
          - local_gateway_id           = ""
          - nat_gateway_id             = ""
          - network_interface_id       = ""
          - transit_gateway_id         = "tgw-02xxxxxxxxxxx5"
          - vpc_endpoint_id            = ""
          - vpc_peering_connection_id  = ""
        },
      + {
          + carrier_gateway_id         = ""
          + cidr_block                 = "172.16.0.0/12"
          + destination_prefix_list_id = ""
          + egress_only_gateway_id     = ""
          + gateway_id                 = ""
          + instance_id                = ""
          + ipv6_cidr_block            = ""
          + local_gateway_id           = ""
          + nat_gateway_id             = ""
          + network_interface_id       = "eni-042xxxxxxxxxx78"
          + transit_gateway_id         = ""
          + vpc_endpoint_id            = ""
          + vpc_peering_connection_id  = ""
        },
      - {
          - carrier_gateway_id         = ""
          - cidr_block                 = "172.16.0.0/12"
          - destination_prefix_list_id = ""
          - egress_only_gateway_id     = ""
          - gateway_id                 = ""
          - instance_id                = "i-04xxxxxxxxxxxxxx8"
          - ipv6_cidr_block            = ""
          - local_gateway_id           = ""
          - nat_gateway_id             = ""
          - network_interface_id       = "eni-042xxxxxxxxxx78"
          - transit_gateway_id         = ""
          - vpc_endpoint_id            = ""
          - vpc_peering_connection_id  = ""
        },
      + {
          + carrier_gateway_id         = null
          + cidr_block                 = "10.0.0.0/8"
          + destination_prefix_list_id = null
          + egress_only_gateway_id     = null
          + gateway_id                 = null
          + instance_id                = null
          + ipv6_cidr_block            = null
          + local_gateway_id           = null
          + nat_gateway_id             = null
          + network_interface_id       = null
          + transit_gateway_id         = "tgw-02xxxxxxxxxxx5"
          + vpc_endpoint_id            = null
          + vpc_peering_connection_id  = null
        },
    ]
wmyre commented 1 year ago

I am experiencing the same issue, and have been for a year. It's extremely frustrating and hard to work around. It seems this has not been addressed for several years based on how many people online are complaining about this. When will this get fixed ? What's a temporary workaround here? Can we get some eyes on this please?

wmyre commented 1 year ago

@ewbankkit