github.com/minamijoyo/terraform@v0.7.8-0.20161029001309-18b3736ba44b/builtin/providers/aws/import_aws_elasticache_replication_group_test.go (about)

     1  package aws
     2  
     3  import (
     4  	"os"
     5  	"testing"
     6  
     7  	"github.com/hashicorp/terraform/helper/acctest"
     8  	"github.com/hashicorp/terraform/helper/resource"
     9  )
    10  
    11  func TestAccAWSElasticacheReplicationGroup_importBasic(t *testing.T) {
    12  	oldvar := os.Getenv("AWS_DEFAULT_REGION")
    13  	os.Setenv("AWS_DEFAULT_REGION", "us-east-1")
    14  	defer os.Setenv("AWS_DEFAULT_REGION", oldvar)
    15  
    16  	name := acctest.RandString(10)
    17  
    18  	resourceName := "aws_elasticache_replication_group.bar"
    19  
    20  	resource.Test(t, resource.TestCase{
    21  		PreCheck:     func() { testAccPreCheck(t) },
    22  		Providers:    testAccProviders,
    23  		CheckDestroy: testAccCheckAWSElasticacheReplicationDestroy,
    24  		Steps: []resource.TestStep{
    25  			resource.TestStep{
    26  				Config: testAccAWSElasticacheReplicationGroupConfig(name),
    27  			},
    28  
    29  			resource.TestStep{
    30  				ResourceName:            resourceName,
    31  				ImportState:             true,
    32  				ImportStateVerify:       true,
    33  				ImportStateVerifyIgnore: []string{"apply_immediately"}, //not in the API
    34  			},
    35  		},
    36  	})
    37  }