Merge pull request #7338 from hashicorp/import-aws-dbpg

provider/aws: Support Import for `aws_db_parameter_group`
This commit is contained in:
James Nugent 2016-07-05 13:51:51 +01:00 committed by GitHub
commit 730d59734f
2 changed files with 35 additions and 0 deletions

View File

@ -0,0 +1,31 @@
package aws
import (
"fmt"
"testing"
"github.com/hashicorp/terraform/helper/acctest"
"github.com/hashicorp/terraform/helper/resource"
)
func TestAccAWSDBParameterGroup_importBasic(t *testing.T) {
resourceName := "aws_db_parameter_group.bar"
groupName := fmt.Sprintf("parameter-group-test-terraform-%d", acctest.RandInt())
resource.Test(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
Providers: testAccProviders,
CheckDestroy: testAccCheckAWSDBParameterGroupDestroy,
Steps: []resource.TestStep{
resource.TestStep{
Config: testAccAWSDBParameterGroupConfig(groupName),
},
resource.TestStep{
ResourceName: resourceName,
ImportState: true,
ImportStateVerify: true,
},
},
})
}

View File

@ -23,6 +23,10 @@ func resourceAwsDbParameterGroup() *schema.Resource {
Read: resourceAwsDbParameterGroupRead,
Update: resourceAwsDbParameterGroupUpdate,
Delete: resourceAwsDbParameterGroupDelete,
Importer: &schema.ResourceImporter{
State: schema.ImportStatePassthrough,
},
Schema: map[string]*schema.Schema{
"arn": &schema.Schema{
Type: schema.TypeString,