providers/aws: route table import should ignore default rule

This commit is contained in:
Mitchell Hashimoto 2016-05-13 12:16:03 -07:00
parent 08b7f67227
commit a1035804d4
No known key found for this signature in database
GPG Key ID: 744E147AA52F5B0A
2 changed files with 6 additions and 1 deletions

View File

@ -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")

View File

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