From 86c16612053aa4d063cacb15ae5bb01c14fbb505 Mon Sep 17 00:00:00 2001 From: Radek Simko Date: Tue, 12 Jul 2016 00:12:10 +0100 Subject: [PATCH] provider/aws: Allow import of efs_mount_target --- .../aws/import_aws_efs_mount_target_test.go | 28 +++++++++++++++++++ .../aws/resource_aws_efs_mount_target.go | 4 +++ 2 files changed, 32 insertions(+) create mode 100644 builtin/providers/aws/import_aws_efs_mount_target_test.go diff --git a/builtin/providers/aws/import_aws_efs_mount_target_test.go b/builtin/providers/aws/import_aws_efs_mount_target_test.go new file mode 100644 index 000000000..f27175f5c --- /dev/null +++ b/builtin/providers/aws/import_aws_efs_mount_target_test.go @@ -0,0 +1,28 @@ +package aws + +import ( + "testing" + + "github.com/hashicorp/terraform/helper/resource" +) + +func TestAccAWSEFSMountTarget_importBasic(t *testing.T) { + resourceName := "aws_efs_mount_target.alpha" + + resource.Test(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckEfsMountTargetDestroy, + Steps: []resource.TestStep{ + resource.TestStep{ + Config: testAccAWSEFSMountTargetConfig, + }, + + resource.TestStep{ + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, + }, + }) +} diff --git a/builtin/providers/aws/resource_aws_efs_mount_target.go b/builtin/providers/aws/resource_aws_efs_mount_target.go index de15ac760..34597230e 100644 --- a/builtin/providers/aws/resource_aws_efs_mount_target.go +++ b/builtin/providers/aws/resource_aws_efs_mount_target.go @@ -20,6 +20,10 @@ func resourceAwsEfsMountTarget() *schema.Resource { Update: resourceAwsEfsMountTargetUpdate, Delete: resourceAwsEfsMountTargetDelete, + Importer: &schema.ResourceImporter{ + State: schema.ImportStatePassthrough, + }, + Schema: map[string]*schema.Schema{ "file_system_id": &schema.Schema{ Type: schema.TypeString,