terraform-provider-google/google/import_container_cluster_test.go
2017-09-07 10:31:58 -07:00

33 lines
799 B
Go

package google
import (
"fmt"
"testing"
"github.com/hashicorp/terraform/helper/acctest"
"github.com/hashicorp/terraform/helper/resource"
)
func TestAccGoogleContainerCluster_import(t *testing.T) {
resourceName := "google_container_cluster.primary"
name := fmt.Sprintf("tf-cluster-test-%s", acctest.RandString(10))
conf := testAccContainerCluster_basic(name)
resource.Test(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
Providers: testAccProviders,
CheckDestroy: testAccCheckContainerClusterDestroy,
Steps: []resource.TestStep{
resource.TestStep{
Config: conf,
},
resource.TestStep{
ResourceName: resourceName,
ImportStateIdPrefix: "us-central1-a/",
ImportState: true,
ImportStateVerify: true,
},
},
})
}