Merge pull request #7288 from hashicorp/import-aws-redshiftsng

provider/aws: Support Import for `aws_redshift_subnet_group`
This commit is contained in:
James Nugent 2016-06-23 10:51:20 +03:00 committed by GitHub
commit 5043114d33
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 TestAccAWSRedshiftSubnetGroup_importBasic(t *testing.T) {
resourceName := "aws_redshift_subnet_group.foo"
resource.Test(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
Providers: testAccProviders,
CheckDestroy: testAccCheckRedshiftSubnetGroupDestroy,
Steps: []resource.TestStep{
resource.TestStep{
Config: testAccRedshiftSubnetGroupConfig,
},
resource.TestStep{
ResourceName: resourceName,
ImportState: true,
ImportStateVerify: true,
ImportStateVerifyIgnore: []string{
"description"},
},
},
})
}

View File

@ -19,6 +19,9 @@ func resourceAwsRedshiftSubnetGroup() *schema.Resource {
Read: resourceAwsRedshiftSubnetGroupRead, Read: resourceAwsRedshiftSubnetGroupRead,
Update: resourceAwsRedshiftSubnetGroupUpdate, Update: resourceAwsRedshiftSubnetGroupUpdate,
Delete: resourceAwsRedshiftSubnetGroupDelete, Delete: resourceAwsRedshiftSubnetGroupDelete,
Importer: &schema.ResourceImporter{
State: schema.ImportStatePassthrough,
},
Schema: map[string]*schema.Schema{ Schema: map[string]*schema.Schema{
"name": &schema.Schema{ "name": &schema.Schema{