diff --git a/pkg/middlewares/aws_route_table_expander.go b/pkg/middlewares/aws_route_table_expander.go index 9fc0fb06..e5067b9d 100644 --- a/pkg/middlewares/aws_route_table_expander.go +++ b/pkg/middlewares/aws_route_table_expander.go @@ -224,15 +224,9 @@ func (m *AwsRouteTableExpander) handleDefaultTable(table *aws.AwsDefaultRouteTab func (m *AwsRouteTableExpander) routeExists(routeId string, resourcesFromState []resource.Resource) bool { for _, res := range resourcesFromState { - if res.TerraformType() != aws.AwsRouteResourceType { - continue + if res.TerraformType() == aws.AwsRouteResourceType && res.TerraformId() == routeId { + return true } - - if res.TerraformId() != routeId { - continue - } - - return true } return false