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 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 } 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 } 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 } 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 }