provider/aws: Support Import for `aws_redshift_parameter_group` (#7339)

```
make testacc TEST=./builtin/providers/aws
TESTARGS='-run=TestAccAWSRedshiftParameterGroup_'
==> Checking that code complies with gofmt requirements...
go generate $(go list ./... | grep -v /vendor/)
TF_ACC=1 go test ./builtin/providers/aws -v -run=TestAccAWSRedshiftParameterGroup_ -timeout 120m
=== RUN   TestAccAWSRedshiftParameterGroup_importBasic
--- PASS: TestAccAWSRedshiftParameterGroup_importBasic (25.97s)
=== RUN   TestAccAWSRedshiftParameterGroup_withParameters
--- PASS: TestAccAWSRedshiftParameterGroup_withParameters (21.26s)
=== RUN   TestAccAWSRedshiftParameterGroup_withoutParameters
--- PASS: TestAccAWSRedshiftParameterGroup_withoutParameters (20.79s)
PASS
ok      github.com/hashicorp/terraform/builtin/providers/aws    68.045s
```
This commit is contained in:
Paul Stack 2016-06-28 16:05:03 +01:00 committed by Clint
parent e45437373c
commit 5e52bbaa27
2 changed files with 31 additions and 0 deletions

View File

@ -0,0 +1,28 @@
package aws
import (
"testing"
"github.com/hashicorp/terraform/helper/resource"
)
func TestAccAWSRedshiftParameterGroup_importBasic(t *testing.T) {
resourceName := "aws_redshift_parameter_group.bar"
resource.Test(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
Providers: testAccProviders,
CheckDestroy: testAccCheckAWSRedshiftParameterGroupDestroy,
Steps: []resource.TestStep{
resource.TestStep{
Config: testAccAWSRedshiftParameterGroupConfig,
},
resource.TestStep{
ResourceName: resourceName,
ImportState: true,
ImportStateVerify: true,
},
},
})
}

View File

@ -22,6 +22,9 @@ func resourceAwsRedshiftParameterGroup() *schema.Resource {
Read: resourceAwsRedshiftParameterGroupRead,
Update: resourceAwsRedshiftParameterGroupUpdate,
Delete: resourceAwsRedshiftParameterGroupDelete,
Importer: &schema.ResourceImporter{
State: schema.ImportStatePassthrough,
},
Schema: map[string]*schema.Schema{
"name": &schema.Schema{