@@ -3293,6 +3293,32 @@ func TestAccContainerCluster_withAutopilotKubeletConfig(t *testing.T) {
3293
3293
})
3294
3294
}
3295
3295
3296
+ func TestAccContainerCluster_withAutopilot_withNodePoolDefaults(t *testing.T) {
3297
+ t.Parallel()
3298
+
3299
+ randomSuffix := acctest.RandString(t, 10)
3300
+ clusterName := fmt.Sprintf("tf-test-cluster-%s", randomSuffix)
3301
+ networkName := acctest.BootstrapSharedTestNetwork(t, "gke-cluster")
3302
+ subnetworkName := acctest.BootstrapSubnet(t, "gke-cluster", networkName)
3303
+
3304
+ acctest.VcrTest(t, resource.TestCase{
3305
+ PreCheck: func() { acctest.AccTestPreCheck(t) },
3306
+ ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories(t),
3307
+ CheckDestroy: testAccCheckContainerClusterDestroyProducer(t),
3308
+ Steps: []resource.TestStep{
3309
+ {
3310
+ Config: testAccContainerCluster_withAutopilot_withNodePoolDefaults(clusterName, networkName, subnetworkName),
3311
+ },
3312
+ {
3313
+ ResourceName: "google_container_cluster.primary",
3314
+ ImportState: true,
3315
+ ImportStateVerify: true,
3316
+ ImportStateVerifyIgnore: []string{deletion_protection"},
3317
+ },
3318
+ },
3319
+ })
3320
+ }
3321
+
3296
3322
3297
3323
func TestAccContainerCluster_withAutopilotResourceManagerTags(t *testing.T) {
3298
3324
t.Parallel()
@@ -10594,6 +10620,25 @@ func testAccContainerCluster_withAutopilotKubeletConfigUpdates(name, insecureKub
10594
10620
`, name, insecureKubeletReadonlyPortEnabled)
10595
10621
}
10596
10622
10623
+ func TestAccContainerCluster_withAutopilot_withNodePoolDefaults(name, networkName, subnetworkName string) string {
10624
+ return fmt.Sprintf(`
10625
+ resource "google_container_cluster" "primary" {
10626
+ name = "%s"
10627
+ location = "us-central1"
10628
+ enable_autopilot = true
10629
+
10630
+ node_pool_defaults {
10631
+ node_config_defaults {
10632
+ }
10633
+ }
10634
+
10635
+ deletion_protection = false
10636
+ network = "%s"
10637
+ subnetwork = "%s"
10638
+ }
10639
+ `, name, networkName, subnetworkName)
10640
+ }
10641
+
10597
10642
func testAccContainerCluster_resourceManagerTags(projectID, clusterName, networkName, subnetworkName, randomSuffix string) string {
10598
10643
return fmt.Sprintf(`
10599
10644
data "google_project" "project" {
0 commit comments