Skip to content

Commit ef4851d

Browse files
authored
Merge pull request hashicorp#7592 from TimeIncOSS/f-aws-efs-fs-import
provider/aws: Allow import of efs_file_system
2 parents 6aa9243 + f5ef8f3 commit ef4851d

2 files changed

Lines changed: 33 additions & 0 deletions

File tree

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
package aws
2+
3+
import (
4+
"testing"
5+
6+
"github.com/hashicorp/terraform/helper/resource"
7+
)
8+
9+
func TestAccAWSEFSFileSystem_importBasic(t *testing.T) {
10+
resourceName := "aws_efs_file_system.foo-with-tags"
11+
12+
resource.Test(t, resource.TestCase{
13+
PreCheck: func() { testAccPreCheck(t) },
14+
Providers: testAccProviders,
15+
CheckDestroy: testAccCheckEfsFileSystemDestroy,
16+
Steps: []resource.TestStep{
17+
resource.TestStep{
18+
Config: testAccAWSEFSFileSystemConfigWithTags,
19+
},
20+
21+
resource.TestStep{
22+
ResourceName: resourceName,
23+
ImportState: true,
24+
ImportStateVerify: true,
25+
ImportStateVerifyIgnore: []string{"reference_name"},
26+
},
27+
},
28+
})
29+
}

builtin/providers/aws/resource_aws_efs_file_system.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,10 @@ func resourceAwsEfsFileSystem() *schema.Resource {
1919
Update: resourceAwsEfsFileSystemUpdate,
2020
Delete: resourceAwsEfsFileSystemDelete,
2121

22+
Importer: &schema.ResourceImporter{
23+
State: schema.ImportStatePassthrough,
24+
},
25+
2226
Schema: map[string]*schema.Schema{
2327
"reference_name": &schema.Schema{
2428
Type: schema.TypeString,

0 commit comments

Comments
 (0)