From 1c0a6bc6d3b10113594a15199f26b9470c470b12 Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Wed, 18 May 2016 13:09:56 -0600 Subject: [PATCH] providers/aws: basic route 53 zone import --- .../aws/import_aws_route53_zone_test.go | 28 +++++++++++++++++++ .../aws/resource_aws_route53_zone.go | 3 ++ 2 files changed, 31 insertions(+) create mode 100644 builtin/providers/aws/import_aws_route53_zone_test.go diff --git a/builtin/providers/aws/import_aws_route53_zone_test.go b/builtin/providers/aws/import_aws_route53_zone_test.go new file mode 100644 index 000000000..f2ad82f3f --- /dev/null +++ b/builtin/providers/aws/import_aws_route53_zone_test.go @@ -0,0 +1,28 @@ +package aws + +import ( + "testing" + + "github.com/hashicorp/terraform/helper/resource" +) + +func TestAccAWSRoute53Zone_importBasic(t *testing.T) { + resourceName := "aws_route53_zone.main" + + resource.Test(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckRoute53ZoneDestroy, + Steps: []resource.TestStep{ + resource.TestStep{ + Config: testAccRoute53ZoneConfig, + }, + + resource.TestStep{ + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, + }, + }) +} diff --git a/builtin/providers/aws/resource_aws_route53_zone.go b/builtin/providers/aws/resource_aws_route53_zone.go index 4cbd24d2d..52a7976c0 100644 --- a/builtin/providers/aws/resource_aws_route53_zone.go +++ b/builtin/providers/aws/resource_aws_route53_zone.go @@ -21,6 +21,9 @@ func resourceAwsRoute53Zone() *schema.Resource { Read: resourceAwsRoute53ZoneRead, Update: resourceAwsRoute53ZoneUpdate, Delete: resourceAwsRoute53ZoneDelete, + Importer: &schema.ResourceImporter{ + State: schema.ImportStatePassthrough, + }, Schema: map[string]*schema.Schema{ "name": &schema.Schema{