diff --git a/mmv1/third_party/terraform/services/container/resource_container_cluster_test.go.erb b/mmv1/third_party/terraform/services/container/resource_container_cluster_test.go.erb index 09acb83d890d..1b16ccca00fa 100644 --- a/mmv1/third_party/terraform/services/container/resource_container_cluster_test.go.erb +++ b/mmv1/third_party/terraform/services/container/resource_container_cluster_test.go.erb @@ -4230,6 +4230,45 @@ func TestAccContainerCluster_withSecurityPostureConfig(t *testing.T) { }) } +func TestAccContainerCluster_withFleetConfig(t *testing.T) { + t.Parallel() + + clusterName := fmt.Sprintf("tf-test-cluster-%s", acctest.RandString(t, 10)) + projectID := envvar.GetTestProjectFromEnv() + + acctest.VcrTest(t, resource.TestCase{ + PreCheck: func() { acctest.AccTestPreCheck(t) }, + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories(t), + CheckDestroy: testAccCheckContainerClusterDestroyProducer(t), + Steps: []resource.TestStep{ + { + Config: testAccContainerCluster_withFleetConfig(clusterName, projectID), + }, + { + ResourceName: "google_container_cluster.primary", + ImportState: true, + ImportStateVerify: true, + ImportStateVerifyIgnore: []string{"min_master_version", "deletion_protection"}, + }, + }, + }) +} + +func testAccContainerCluster_withFleetConfig(name, projectID string) string { + return fmt.Sprintf(` +resource "google_container_cluster" "primary" { + name = "%s" + location = "us-central1-a" + initial_node_count = 1 + + fleet { + project = "%s" + } + deletion_protection = false +} +`, name, projectID) +} + func testAccContainerCluster_SetSecurityPostureToStandard(resource_name, networkName, subnetworkName string) string { return fmt.Sprintf(` resource "google_container_cluster" "with_security_posture_config" { @@ -9130,3 +9169,4 @@ resource "google_container_cluster" "without_confidential_boot_disk" { `, clusterName, npName) } <% end -%> +