Merge pull request #7289 from hashicorp/import-aws-vpcendpoint

provider/aws: Support Import for `aws_vpc_endpoint`
This commit is contained in:
James Nugent 2016-06-23 10:50:55 +03:00 committed by GitHub
commit eefd2d5a7c
2 changed files with 32 additions and 0 deletions

View File

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

View File

@ -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,