Ignore blackhole NAT routes

This commit is contained in:
Peter Rifel 2024-10-06 07:12:00 -05:00
parent e944836704
commit c937ae11a6
No known key found for this signature in database
1 changed files with 1 additions and 1 deletions

View File

@ -215,7 +215,7 @@ func findNatGatewayFromRouteTable(ctx context.Context, cloud awsup.AWSCloud, rou
var natGatewayIDs []*string
natGatewayIDsSeen := map[string]bool{}
for _, route := range rt.Routes {
if route.NatGatewayId != nil && !natGatewayIDsSeen[*route.NatGatewayId] {
if route.NatGatewayId != nil && route.State != ec2types.RouteStateBlackhole && !natGatewayIDsSeen[*route.NatGatewayId] {
natGatewayIDs = append(natGatewayIDs, route.NatGatewayId)
natGatewayIDsSeen[*route.NatGatewayId] = true
}