From 798a063596c6e71fb4ac1432b26ccff63a46c239 Mon Sep 17 00:00:00 2001 From: Otto Jongerius Date: Mon, 25 May 2015 16:23:44 +1000 Subject: [PATCH 1/2] Ignore S3 VPC endpoint routes. --- .../providers/aws/resource_aws_route_table.go | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/builtin/providers/aws/resource_aws_route_table.go b/builtin/providers/aws/resource_aws_route_table.go index 26248bac1204..ba906aef5720 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 endpoints are special; They will not have a DestinationCidrBlock, + // The result is an object that will choke aws.resourceAwsRouteTableHash + // skip it is supported. + if s3VpcEndpointRegExp.MatchString(*r.GatewayID) { + continue + } } if r.Origin != nil && *r.Origin == "EnableVgwRoutePropagation" { From 740666e07f0e15756bf8b876ba0e8777408c27b9 Mon Sep 17 00:00:00 2001 From: Otto Jongerius Date: Mon, 25 May 2015 16:29:16 +1000 Subject: [PATCH 2/2] Update wording of comment. --- builtin/providers/aws/resource_aws_route_table.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/builtin/providers/aws/resource_aws_route_table.go b/builtin/providers/aws/resource_aws_route_table.go index ba906aef5720..3eca1cf5f75e 100644 --- a/builtin/providers/aws/resource_aws_route_table.go +++ b/builtin/providers/aws/resource_aws_route_table.go @@ -148,9 +148,9 @@ func resourceAwsRouteTableRead(d *schema.ResourceData, meta interface{}) error { continue } - // VPC endpoints are special; They will not have a DestinationCidrBlock, - // The result is an object that will choke aws.resourceAwsRouteTableHash - // skip it is supported. + // 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 }