Merge pull request #7289 from hashicorp/import-aws-vpcendpoint
provider/aws: Support Import for `aws_vpc_endpoint`
This commit is contained in:
commit
eefd2d5a7c
|
@ -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,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
})
|
||||||
|
}
|
|
@ -16,6 +16,10 @@ func resourceAwsVpcEndpoint() *schema.Resource {
|
||||||
Read: resourceAwsVPCEndpointRead,
|
Read: resourceAwsVPCEndpointRead,
|
||||||
Update: resourceAwsVPCEndpointUpdate,
|
Update: resourceAwsVPCEndpointUpdate,
|
||||||
Delete: resourceAwsVPCEndpointDelete,
|
Delete: resourceAwsVPCEndpointDelete,
|
||||||
|
Importer: &schema.ResourceImporter{
|
||||||
|
State: schema.ImportStatePassthrough,
|
||||||
|
},
|
||||||
|
|
||||||
Schema: map[string]*schema.Schema{
|
Schema: map[string]*schema.Schema{
|
||||||
"policy": &schema.Schema{
|
"policy": &schema.Schema{
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
|
|
Loading…
Reference in New Issue