Merge pull request #7285 from hashicorp/import-aws-ecsng
provider/aws: Support Import for `aws_elasticache_subnet_group`
This commit is contained in:
commit
73b823ba47
|
@ -0,0 +1,34 @@
|
||||||
|
package aws
|
||||||
|
|
||||||
|
import (
|
||||||
|
"testing"
|
||||||
|
|
||||||
|
"fmt"
|
||||||
|
|
||||||
|
"github.com/hashicorp/terraform/helper/acctest"
|
||||||
|
"github.com/hashicorp/terraform/helper/resource"
|
||||||
|
)
|
||||||
|
|
||||||
|
func TestAccAWSElasticacheSubnetGroup_importBasic(t *testing.T) {
|
||||||
|
resourceName := "aws_elasticache_subnet_group.bar"
|
||||||
|
config := fmt.Sprintf(testAccAWSElasticacheSubnetGroupConfig, acctest.RandInt())
|
||||||
|
|
||||||
|
resource.Test(t, resource.TestCase{
|
||||||
|
PreCheck: func() { testAccPreCheck(t) },
|
||||||
|
Providers: testAccProviders,
|
||||||
|
CheckDestroy: testAccCheckAWSElasticacheSubnetGroupDestroy,
|
||||||
|
Steps: []resource.TestStep{
|
||||||
|
resource.TestStep{
|
||||||
|
Config: config,
|
||||||
|
},
|
||||||
|
|
||||||
|
resource.TestStep{
|
||||||
|
ResourceName: resourceName,
|
||||||
|
ImportState: true,
|
||||||
|
ImportStateVerify: true,
|
||||||
|
ImportStateVerifyIgnore: []string{
|
||||||
|
"description"},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
})
|
||||||
|
}
|
|
@ -19,6 +19,9 @@ func resourceAwsElasticacheSubnetGroup() *schema.Resource {
|
||||||
Read: resourceAwsElasticacheSubnetGroupRead,
|
Read: resourceAwsElasticacheSubnetGroupRead,
|
||||||
Update: resourceAwsElasticacheSubnetGroupUpdate,
|
Update: resourceAwsElasticacheSubnetGroupUpdate,
|
||||||
Delete: resourceAwsElasticacheSubnetGroupDelete,
|
Delete: resourceAwsElasticacheSubnetGroupDelete,
|
||||||
|
Importer: &schema.ResourceImporter{
|
||||||
|
State: schema.ImportStatePassthrough,
|
||||||
|
},
|
||||||
|
|
||||||
Schema: map[string]*schema.Schema{
|
Schema: map[string]*schema.Schema{
|
||||||
"description": &schema.Schema{
|
"description": &schema.Schema{
|
||||||
|
|
Loading…
Reference in New Issue