From 4e3488afb880680f35d6dc8c35de4ef51a357349 Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Fri, 13 May 2016 13:07:36 -0700 Subject: [PATCH] providers/aws: customer gateway import --- .../aws/import_aws_customer_gateway_test.go | 28 +++++++++++++++++++ .../aws/resource_aws_customer_gateway.go | 3 ++ 2 files changed, 31 insertions(+) create mode 100644 builtin/providers/aws/import_aws_customer_gateway_test.go diff --git a/builtin/providers/aws/import_aws_customer_gateway_test.go b/builtin/providers/aws/import_aws_customer_gateway_test.go new file mode 100644 index 000000000..37662760d --- /dev/null +++ b/builtin/providers/aws/import_aws_customer_gateway_test.go @@ -0,0 +1,28 @@ +package aws + +import ( + "testing" + + "github.com/hashicorp/terraform/helper/resource" +) + +func TestAccAWSCustomerGateway_importBasic(t *testing.T) { + resourceName := "aws_customer_gateway.foo" + + resource.Test(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckCustomerGatewayDestroy, + Steps: []resource.TestStep{ + resource.TestStep{ + Config: testAccCustomerGatewayConfig, + }, + + resource.TestStep{ + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, + }, + }) +} diff --git a/builtin/providers/aws/resource_aws_customer_gateway.go b/builtin/providers/aws/resource_aws_customer_gateway.go index e98dcaf75..c7e386161 100644 --- a/builtin/providers/aws/resource_aws_customer_gateway.go +++ b/builtin/providers/aws/resource_aws_customer_gateway.go @@ -20,6 +20,9 @@ func resourceAwsCustomerGateway() *schema.Resource { Read: resourceAwsCustomerGatewayRead, Update: resourceAwsCustomerGatewayUpdate, Delete: resourceAwsCustomerGatewayDelete, + Importer: &schema.ResourceImporter{ + State: schema.ImportStatePassthrough, + }, Schema: map[string]*schema.Schema{ "bgp_asn": &schema.Schema{