github.com/danp/terraform@v0.9.5-0.20170426144147-39d740081351/builtin/providers/aws/import_aws_db_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 TestAccAWSDBSecurityGroup_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_db_security_group.bar"
    16  
    17  	resource.Test(t, resource.TestCase{
    18  		PreCheck:     func() { testAccPreCheck(t) },
    19  		Providers:    testAccProviders,
    20  		CheckDestroy: testAccCheckAWSDBSecurityGroupDestroy,
    21  		Steps: []resource.TestStep{
    22  			resource.TestStep{
    23  				Config: testAccAWSDBSecurityGroupConfig,
    24  			},
    25  
    26  			resource.TestStep{
    27  				ResourceName:      resourceName,
    28  				ImportState:       true,
    29  				ImportStateVerify: true,
    30  			},
    31  		},
    32  	})
    33  }