diff --git a/builtin/providers/aws/import_aws_vpc_peering_connection_test.go b/builtin/providers/aws/import_aws_vpc_peering_connection_test.go new file mode 100644 index 000000000..c64f84a36 --- /dev/null +++ b/builtin/providers/aws/import_aws_vpc_peering_connection_test.go @@ -0,0 +1,30 @@ +package aws + +import ( + "testing" + + "github.com/hashicorp/terraform/helper/resource" +) + +func TestAccAWSVPCPeeringConnection_importBasic(t *testing.T) { + resourceName := "aws_vpc_peering_connection.foo" + + resource.Test(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckAWSVpcPeeringConnectionDestroy, + Steps: []resource.TestStep{ + resource.TestStep{ + Config: testAccVpcPeeringConfig, + }, + + resource.TestStep{ + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + ImportStateVerifyIgnore: []string{ + "auto_accept"}, + }, + }, + }) +} diff --git a/builtin/providers/aws/resource_aws_vpc_peering_connection.go b/builtin/providers/aws/resource_aws_vpc_peering_connection.go index 8c48b0e96..2bfc341b6 100644 --- a/builtin/providers/aws/resource_aws_vpc_peering_connection.go +++ b/builtin/providers/aws/resource_aws_vpc_peering_connection.go @@ -18,6 +18,9 @@ func resourceAwsVpcPeeringConnection() *schema.Resource { Read: resourceAwsVPCPeeringRead, Update: resourceAwsVPCPeeringUpdate, Delete: resourceAwsVPCPeeringDelete, + Importer: &schema.ResourceImporter{ + State: schema.ImportStatePassthrough, + }, Schema: map[string]*schema.Schema{ "peer_owner_id": &schema.Schema{