@@ -3370,6 +3370,32 @@ func TestAccContainerCluster_withAutopilotKubeletConfig(t *testing.T) {
3370
3370
})
3371
3371
}
3372
3372
3373
+ func TestAccContainerCluster_withAutopilot_withNodePoolDefaults(t *testing.T) {
3374
+ t.Parallel()
3375
+
3376
+ randomSuffix := acctest.RandString(t, 10)
3377
+ clusterName := fmt.Sprintf("tf-test-cluster-%s", randomSuffix)
3378
+ networkName := acctest.BootstrapSharedTestNetwork(t, "gke-cluster")
3379
+ subnetworkName := acctest.BootstrapSubnet(t, "gke-cluster", networkName)
3380
+
3381
+ acctest.VcrTest(t, resource.TestCase{
3382
+ PreCheck: func() { acctest.AccTestPreCheck(t) },
3383
+ ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories(t),
3384
+ CheckDestroy: testAccCheckContainerClusterDestroyProducer(t),
3385
+ Steps: []resource.TestStep{
3386
+ {
3387
+ Config: testAccContainerCluster_withAutopilot_withNodePoolDefaults(clusterName, networkName, subnetworkName),
3388
+ },
3389
+ {
3390
+ ResourceName: "google_container_cluster.primary",
3391
+ ImportState: true,
3392
+ ImportStateVerify: true,
3393
+ ImportStateVerifyIgnore: []string{"deletion_protection"},
3394
+ },
3395
+ },
3396
+ })
3397
+ }
3398
+
3373
3399
3374
3400
func TestAccContainerCluster_withAutopilotResourceManagerTags(t *testing.T) {
3375
3401
t.Parallel()
@@ -10710,6 +10736,25 @@ func testAccContainerCluster_withAutopilotKubeletConfigUpdates(name, insecureKub
10710
10736
`, name, insecureKubeletReadonlyPortEnabled)
10711
10737
}
10712
10738
10739
+ func testAccContainerCluster_withAutopilot_withNodePoolDefaults(name, networkName, subnetworkName string) string {
10740
+ return fmt.Sprintf(`
10741
+ resource "google_container_cluster" "primary" {
10742
+ name = "%s"
10743
+ location = "us-central1"
10744
+ enable_autopilot = true
10745
+
10746
+ node_pool_defaults {
10747
+ node_config_defaults {
10748
+ }
10749
+ }
10750
+
10751
+ deletion_protection = false
10752
+ network = "%s"
10753
+ subnetwork = "%s"
10754
+ }
10755
+ `, name, networkName, subnetworkName)
10756
+ }
10757
+
10713
10758
func testAccContainerCluster_resourceManagerTags(projectID, clusterName, networkName, subnetworkName, randomSuffix string) string {
10714
10759
return fmt.Sprintf(`
10715
10760
data "google_project" "project" {
0 commit comments