mirror of
https://github.com/letic/terraform-provider-google.git
synced 2024-09-06 00:56:43 +00:00
35 lines
863 B
Go
35 lines
863 B
Go
package google
|
|
|
|
import (
|
|
"fmt"
|
|
"testing"
|
|
|
|
"github.com/hashicorp/terraform/helper/acctest"
|
|
"github.com/hashicorp/terraform/helper/resource"
|
|
)
|
|
|
|
func TestAccKmsKeyRing_importBasic(t *testing.T) {
|
|
resourceName := "google_kms_key_ring.key_ring"
|
|
|
|
projectId := "terraform-" + acctest.RandString(10)
|
|
projectOrg := getTestOrgFromEnv(t)
|
|
projectBillingAccount := getTestBillingAccountFromEnv(t)
|
|
keyRingName := fmt.Sprintf("tf-test-%s", acctest.RandString(10))
|
|
|
|
resource.Test(t, resource.TestCase{
|
|
PreCheck: func() { testAccPreCheck(t) },
|
|
Providers: testAccProviders,
|
|
Steps: []resource.TestStep{
|
|
resource.TestStep{
|
|
Config: testGoogleKmsKeyRing_basic(projectId, projectOrg, projectBillingAccount, keyRingName),
|
|
},
|
|
|
|
resource.TestStep{
|
|
ResourceName: resourceName,
|
|
ImportState: true,
|
|
ImportStateVerify: true,
|
|
},
|
|
},
|
|
})
|
|
}
|