diff --git a/builtin/providers/aws/import_aws_route_table.go b/builtin/providers/aws/import_aws_route_table.go index 0c877b3ef4..a1a897fa3f 100644 --- a/builtin/providers/aws/import_aws_route_table.go +++ b/builtin/providers/aws/import_aws_route_table.go @@ -33,6 +33,11 @@ func resourceAwsRouteTableImportState( // Construct the routes subResource := resourceAwsRoute() for _, route := range table.Routes { + // Ignore the local/default route + if route.GatewayId != nil && *route.GatewayId == "local" { + continue + } + // Minimal data for route d := subResource.Data(nil) d.SetType("aws_route") diff --git a/builtin/providers/aws/import_aws_route_table_test.go b/builtin/providers/aws/import_aws_route_table_test.go index c0a9537b90..43727b7bbb 100644 --- a/builtin/providers/aws/import_aws_route_table_test.go +++ b/builtin/providers/aws/import_aws_route_table_test.go @@ -11,7 +11,7 @@ import ( func TestAccAWSRouteTable_importBasic(t *testing.T) { checkFn := func(s []*terraform.InstanceState) error { // Expect 2: group, 1 rules - if len(s) != 3 { + if len(s) != 2 { return fmt.Errorf("bad states: %#v", s) }