From 534b4fe51b0405c33b2c7d4f3586dde9aae0ef97 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Thu, 6 Apr 2023 14:40:53 -0400 Subject: [PATCH 1/5] r/aws_route_table: Ignore routes managed by VPC Lattice. --- internal/service/ec2/vpc_route_table.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/service/ec2/vpc_route_table.go b/internal/service/ec2/vpc_route_table.go index dabd9be2a05..73475e976f4 100644 --- a/internal/service/ec2/vpc_route_table.go +++ b/internal/service/ec2/vpc_route_table.go @@ -872,7 +872,7 @@ func flattenRoutes(ctx context.Context, conn *ec2.EC2, apiObjects []*ec2.Route) continue } - if aws.StringValue(apiObject.GatewayId) == "local" { + if gatewayID := aws.StringValue(apiObject.GatewayId); gatewayID == "local" || gatewayID == "VpcLattice" { continue } From f795cadf01c52812f38df372570849c74c14db82 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Thu, 6 Apr 2023 14:41:15 -0400 Subject: [PATCH 2/5] d/aws_route_table: Ignore routes managed by VPC Lattice. --- internal/service/ec2/vpc_route_table_data_source.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/service/ec2/vpc_route_table_data_source.go b/internal/service/ec2/vpc_route_table_data_source.go index 7461f4bd1b4..c31ec7e568b 100644 --- a/internal/service/ec2/vpc_route_table_data_source.go +++ b/internal/service/ec2/vpc_route_table_data_source.go @@ -259,7 +259,7 @@ func dataSourceRoutesRead(ctx context.Context, conn *ec2.EC2, ec2Routes []*ec2.R routes := make([]map[string]interface{}, 0, len(ec2Routes)) // Loop through the routes and add them to the set for _, r := range ec2Routes { - if aws.StringValue(r.GatewayId) == "local" { + if gatewayID := aws.StringValue(r.GatewayId); gatewayID == "local" || gatewayID == "VpcLattice" { continue } From 7cb1a1a55a1b2cca0dc529119a22708cf6e80d17 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Thu, 6 Apr 2023 14:42:06 -0400 Subject: [PATCH 3/5] r/aws_default_route_table: Ignore routes managed by VPC Lattice. --- internal/service/ec2/vpc_default_route_table.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/internal/service/ec2/vpc_default_route_table.go b/internal/service/ec2/vpc_default_route_table.go index 34b5aec055c..da58a8ed36e 100644 --- a/internal/service/ec2/vpc_default_route_table.go +++ b/internal/service/ec2/vpc_default_route_table.go @@ -170,8 +170,7 @@ func resourceDefaultRouteTableCreate(ctx context.Context, d *schema.ResourceData // Delete all existing routes. for _, v := range routeTable.Routes { - // you cannot delete the local route - if aws.StringValue(v.GatewayId) == "local" { + if gatewayID := aws.StringValue(v.GatewayId); gatewayID == "local" || gatewayID == "VpcLattice" { continue } From b455b28d4d9b2ac905414107484419928eda9c11 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Thu, 6 Apr 2023 14:42:45 -0400 Subject: [PATCH 4/5] r/aws_route_table: Ignore routes managed by VPC Lattice in test sweeper. --- internal/service/ec2/sweep.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/service/ec2/sweep.go b/internal/service/ec2/sweep.go index fa6badf2564..0fb60c6b984 100644 --- a/internal/service/ec2/sweep.go +++ b/internal/service/ec2/sweep.go @@ -1428,7 +1428,7 @@ func sweepRouteTables(region string) error { continue } - if aws.StringValue(route.GatewayId) == "local" { + if gatewayID := aws.StringValue(route.GatewayId); gatewayID == "local" || gatewayID == "VpcLattice" { continue } From b1f44f02fe8d45e56d76fae62ee58f0c60e5dc7d Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Thu, 6 Apr 2023 14:55:17 -0400 Subject: [PATCH 5/5] Add CHANGELOG entries. --- .changelog/30515.txt | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 .changelog/30515.txt diff --git a/.changelog/30515.txt b/.changelog/30515.txt new file mode 100644 index 00000000000..e5ee75bfa27 --- /dev/null +++ b/.changelog/30515.txt @@ -0,0 +1,11 @@ +```release-note:enhancement +resource/aws_route_table: Ignore routes managed by VPC Lattice +``` + +```release-note:enhancement +data-source/aws_route_table: Ignore routes managed by VPC Lattice +``` + +```release-note:enhancement +resource/aws_default_route_table: Ignore routes managed by VPC Lattice +``` \ No newline at end of file