Merge pull request #7592 from TimeIncOSS/f-aws-efs-fs-import

provider/aws: Allow import of efs_file_system
This commit is contained in:
Radek Simko 2016-07-12 00:17:14 +01:00 committed by GitHub
commit ef4851d524
2 changed files with 33 additions and 0 deletions

View File

@ -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"},
},
},
})
}

View File

@ -19,6 +19,10 @@ func resourceAwsEfsFileSystem() *schema.Resource {
Update: resourceAwsEfsFileSystemUpdate, Update: resourceAwsEfsFileSystemUpdate,
Delete: resourceAwsEfsFileSystemDelete, Delete: resourceAwsEfsFileSystemDelete,
Importer: &schema.ResourceImporter{
State: schema.ImportStatePassthrough,
},
Schema: map[string]*schema.Schema{ Schema: map[string]*schema.Schema{
"reference_name": &schema.Schema{ "reference_name": &schema.Schema{
Type: schema.TypeString, Type: schema.TypeString,