Merge pull request #7286 from hashicorp/import-aws-dbsng

provider/aws: Support Import functionality for `aws_db_subnet_group`
This commit is contained in:
James Nugent 2016-06-23 10:52:04 +03:00 committed by GitHub
commit a6ae8eaac8
2 changed files with 33 additions and 0 deletions

View File

@ -0,0 +1,30 @@
package aws
import (
"testing"
"github.com/hashicorp/terraform/helper/resource"
)
func TestAccAWSDBSubnetGroup_importBasic(t *testing.T) {
resourceName := "aws_db_subnet_group.foo"
resource.Test(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
Providers: testAccProviders,
CheckDestroy: testAccCheckDBSubnetGroupDestroy,
Steps: []resource.TestStep{
resource.TestStep{
Config: testAccDBSubnetGroupConfig,
},
resource.TestStep{
ResourceName: resourceName,
ImportState: true,
ImportStateVerify: true,
ImportStateVerifyIgnore: []string{
"description"},
},
},
})
}

View File

@ -21,6 +21,9 @@ func resourceAwsDbSubnetGroup() *schema.Resource {
Read: resourceAwsDbSubnetGroupRead,
Update: resourceAwsDbSubnetGroupUpdate,
Delete: resourceAwsDbSubnetGroupDelete,
Importer: &schema.ResourceImporter{
State: schema.ImportStatePassthrough,
},
Schema: map[string]*schema.Schema{
"arn": &schema.Schema{