Merge pull request #7338 from hashicorp/import-aws-dbpg
provider/aws: Support Import for `aws_db_parameter_group`
This commit is contained in:
commit
730d59734f
|
@ -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,
|
||||
},
|
||||
},
|
||||
})
|
||||
}
|
|
@ -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,
|
||||
|
|
Loading…
Reference in New Issue