diff --git a/builtin/providers/aws/resource_aws_route_table.go b/builtin/providers/aws/resource_aws_route_table.go index 26248bac1204..3eca1cf5f75e 100644 --- a/builtin/providers/aws/resource_aws_route_table.go +++ b/builtin/providers/aws/resource_aws_route_table.go @@ -5,6 +5,7 @@ import ( "fmt" "log" "time" + "regexp" "github.com/awslabs/aws-sdk-go/aws" "github.com/awslabs/aws-sdk-go/aws/awserr" @@ -139,9 +140,20 @@ func resourceAwsRouteTableRead(d *schema.ResourceData, meta interface{}) error { route := &schema.Set{F: resourceAwsRouteTableHash} // Loop through the routes and add them to the set + s3VpcEndpointRegExp := regexp.MustCompile("^vpce-.*") + for _, r := range rt.Routes { - if r.GatewayID != nil && *r.GatewayID == "local" { - continue + if r.GatewayID != nil { + if *r.GatewayID == "local" { + continue + } + + // VPC endpoint routes are special as they will not have a DestinationCidrBlock. + // This results in an object that will choke aws.resourceAwsRouteTableHash, + // skip this until support has been added. + if s3VpcEndpointRegExp.MatchString(*r.GatewayID) { + continue + } } if r.Origin != nil && *r.Origin == "EnableVgwRoutePropagation" {