Skip to content
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

VPC: Ignore route table routes managed by VPC Lattice #30515

Merged
merged 5 commits into from
Apr 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions .changelog/30515.txt
Original file line number Diff line number Diff line change
@@ -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
```
2 changes: 1 addition & 1 deletion internal/service/ec2/sweep.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down
3 changes: 1 addition & 2 deletions internal/service/ec2/vpc_default_route_table.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down
2 changes: 1 addition & 1 deletion internal/service/ec2/vpc_route_table.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down
2 changes: 1 addition & 1 deletion internal/service/ec2/vpc_route_table_data_source.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down