github.com/mohanarpit/terraform@v0.6.16-0.20160909104007-291f29853544/builtin/providers/aws/import_aws_redshift_security_group_test.go (about) 1 package aws 2 3 import ( 4 "os" 5 "testing" 6 7 "github.com/hashicorp/terraform/helper/resource" 8 ) 9 10 func TestAccAWSRedshiftSecurityGroup_importBasic(t *testing.T) { 11 oldvar := os.Getenv("AWS_DEFAULT_REGION") 12 os.Setenv("AWS_DEFAULT_REGION", "us-east-1") 13 defer os.Setenv("AWS_DEFAULT_REGION", oldvar) 14 15 resourceName := "aws_redshift_security_group.bar" 16 17 resource.Test(t, resource.TestCase{ 18 PreCheck: func() { testAccPreCheck(t) }, 19 Providers: testAccProviders, 20 CheckDestroy: testAccCheckAWSRedshiftSecurityGroupDestroy, 21 Steps: []resource.TestStep{ 22 resource.TestStep{ 23 Config: testAccAWSRedshiftSecurityGroupConfig_ingressCidr, 24 }, 25 26 resource.TestStep{ 27 ResourceName: resourceName, 28 ImportState: true, 29 ImportStateVerify: true, 30 }, 31 }, 32 }) 33 }