From f5ef8f36c2ae0fe2fb56729f3336ec2cb8ef3baf Mon Sep 17 00:00:00 2001 From: Radek Simko Date: Tue, 12 Jul 2016 00:02:47 +0100 Subject: [PATCH] provider/aws: Allow import of efs_file_system --- .../aws/import_aws_efs_file_system_test.go | 29 +++++++++++++++++++ .../aws/resource_aws_efs_file_system.go | 4 +++ 2 files changed, 33 insertions(+) create mode 100644 builtin/providers/aws/import_aws_efs_file_system_test.go diff --git a/builtin/providers/aws/import_aws_efs_file_system_test.go b/builtin/providers/aws/import_aws_efs_file_system_test.go new file mode 100644 index 0000000000..b40e7f4965 --- /dev/null +++ b/builtin/providers/aws/import_aws_efs_file_system_test.go @@ -0,0 +1,29 @@ +package aws + +import ( + "testing" + + "github.com/hashicorp/terraform/helper/resource" +) + +func TestAccAWSEFSFileSystem_importBasic(t *testing.T) { + resourceName := "aws_efs_file_system.foo-with-tags" + + resource.Test(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckEfsFileSystemDestroy, + Steps: []resource.TestStep{ + resource.TestStep{ + Config: testAccAWSEFSFileSystemConfigWithTags, + }, + + resource.TestStep{ + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + ImportStateVerifyIgnore: []string{"reference_name"}, + }, + }, + }) +} diff --git a/builtin/providers/aws/resource_aws_efs_file_system.go b/builtin/providers/aws/resource_aws_efs_file_system.go index 90a34143d8..28f4517569 100644 --- a/builtin/providers/aws/resource_aws_efs_file_system.go +++ b/builtin/providers/aws/resource_aws_efs_file_system.go @@ -19,6 +19,10 @@ func resourceAwsEfsFileSystem() *schema.Resource { Update: resourceAwsEfsFileSystemUpdate, Delete: resourceAwsEfsFileSystemDelete, + Importer: &schema.ResourceImporter{ + State: schema.ImportStatePassthrough, + }, + Schema: map[string]*schema.Schema{ "reference_name": &schema.Schema{ Type: schema.TypeString,