github.com/danp/terraform@v0.9.5-0.20170426144147-39d740081351/builtin/providers/aws/import_aws_dynamodb_table_test.go (about) 1 package aws 2 3 import ( 4 "testing" 5 6 "github.com/hashicorp/terraform/helper/acctest" 7 "github.com/hashicorp/terraform/helper/resource" 8 ) 9 10 func TestAccAWSDynamoDbTable_importBasic(t *testing.T) { 11 resourceName := "aws_dynamodb_table.basic-dynamodb-table" 12 13 rName := acctest.RandomWithPrefix("TerraformTestTable-") 14 resource.Test(t, resource.TestCase{ 15 PreCheck: func() { testAccPreCheck(t) }, 16 Providers: testAccProviders, 17 CheckDestroy: testAccCheckAWSDynamoDbTableDestroy, 18 Steps: []resource.TestStep{ 19 { 20 Config: testAccAWSDynamoDbConfigInitialState(rName), 21 }, 22 23 { 24 ResourceName: resourceName, 25 ImportState: true, 26 ImportStateVerify: true, 27 }, 28 }, 29 }) 30 } 31 32 func TestAccAWSDynamoDbTable_importTags(t *testing.T) { 33 resourceName := "aws_dynamodb_table.basic-dynamodb-table" 34 35 resource.Test(t, resource.TestCase{ 36 PreCheck: func() { testAccPreCheck(t) }, 37 Providers: testAccProviders, 38 CheckDestroy: testAccCheckAWSDynamoDbTableDestroy, 39 Steps: []resource.TestStep{ 40 { 41 Config: testAccAWSDynamoDbConfigTags(), 42 }, 43 44 { 45 ResourceName: resourceName, 46 ImportState: true, 47 ImportStateVerify: true, 48 }, 49 }, 50 }) 51 }