diff --git a/builtin/providers/aws/import_aws_vpc_endpoint_test.go b/builtin/providers/aws/import_aws_vpc_endpoint_test.go new file mode 100644 index 000000000..d44c35493 --- /dev/null +++ b/builtin/providers/aws/import_aws_vpc_endpoint_test.go @@ -0,0 +1,28 @@ +package aws + +import ( + "testing" + + "github.com/hashicorp/terraform/helper/resource" +) + +func TestAccAWSVpcEndpoint_importBasic(t *testing.T) { + resourceName := "aws_vpc_endpoint.second-private-s3" + + resource.Test(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckVpcEndpointDestroy, + Steps: []resource.TestStep{ + resource.TestStep{ + Config: testAccVpcEndpointWithRouteTableAndPolicyConfig, + }, + + resource.TestStep{ + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, + }, + }) +} diff --git a/builtin/providers/aws/resource_aws_vpc_endpoint.go b/builtin/providers/aws/resource_aws_vpc_endpoint.go index 9bb7501e2..882572d26 100644 --- a/builtin/providers/aws/resource_aws_vpc_endpoint.go +++ b/builtin/providers/aws/resource_aws_vpc_endpoint.go @@ -16,6 +16,10 @@ func resourceAwsVpcEndpoint() *schema.Resource { Read: resourceAwsVPCEndpointRead, Update: resourceAwsVPCEndpointUpdate, Delete: resourceAwsVPCEndpointDelete, + Importer: &schema.ResourceImporter{ + State: schema.ImportStatePassthrough, + }, + Schema: map[string]*schema.Schema{ "policy": &schema.Schema{ Type: schema.TypeString,