terraform-provider-google/google/import_container_cluster_test.go

35 lines
808 B
Go
Raw Normal View History

2017-09-07 17:31:58 +00:00
package google
import (
"fmt"
"testing"
"github.com/hashicorp/terraform/helper/acctest"
"github.com/hashicorp/terraform/helper/resource"
)
func TestAccContainerCluster_import(t *testing.T) {
t.Parallel()
2017-09-07 17:31:58 +00:00
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,
},
},
})
}