@@ -3072,6 +3072,32 @@ func TestAccContainerCluster_withAutopilotKubeletConfig(t *testing.T) {
3072
3072
})
3073
3073
}
3074
3074
3075
+ func TestAccContainerCluster_withAutopilot_withNodePoolDefaults (t * testing.T ) {
3076
+ t .Parallel ()
3077
+
3078
+ randomSuffix := acctest .RandString (t , 10 )
3079
+ clusterName := fmt .Sprintf ("tf-test-cluster-%s" , randomSuffix )
3080
+ networkName := acctest .BootstrapSharedTestNetwork (t , "gke-cluster" )
3081
+ subnetworkName := acctest .BootstrapSubnet (t , "gke-cluster" , networkName )
3082
+
3083
+ acctest .VcrTest (t , resource.TestCase {
3084
+ PreCheck : func () { acctest .AccTestPreCheck (t ) },
3085
+ ProtoV5ProviderFactories : acctest .ProtoV5ProviderFactories (t ),
3086
+ CheckDestroy : testAccCheckContainerClusterDestroyProducer (t ),
3087
+ Steps : []resource.TestStep {
3088
+ {
3089
+ Config : testAccContainerCluster_withAutopilot_withNodePoolDefaults (clusterName , networkName , subnetworkName ),
3090
+ },
3091
+ {
3092
+ ResourceName : "google_container_cluster.primary" ,
3093
+ ImportState : true ,
3094
+ ImportStateVerify : true ,
3095
+ ImportStateVerifyIgnore : []string {"deletion_protection" },
3096
+ },
3097
+ },
3098
+ })
3099
+ }
3100
+
3075
3101
func TestAccContainerCluster_withAutopilotResourceManagerTags (t * testing.T ) {
3076
3102
t .Parallel ()
3077
3103
@@ -9542,6 +9568,25 @@ func testAccContainerCluster_withAutopilotKubeletConfigUpdates(name, insecureKub
9542
9568
` , name , insecureKubeletReadonlyPortEnabled )
9543
9569
}
9544
9570
9571
+ func testAccContainerCluster_withAutopilot_withNodePoolDefaults (name , networkName , subnetworkName string ) string {
9572
+ return fmt .Sprintf (`
9573
+ resource "google_container_cluster" "primary" {
9574
+ name = "%s"
9575
+ location = "us-central1"
9576
+ enable_autopilot = true
9577
+
9578
+ node_pool_defaults {
9579
+ node_config_defaults {
9580
+ }
9581
+ }
9582
+
9583
+ deletion_protection = false
9584
+ network = "%s"
9585
+ subnetwork = "%s"
9586
+ }
9587
+ ` , name , networkName , subnetworkName )
9588
+ }
9589
+
9545
9590
func testAccContainerCluster_resourceManagerTags (projectID , clusterName , networkName , subnetworkName , randomSuffix string ) string {
9546
9591
return fmt .Sprintf (`
9547
9592
data "google_project" "project" {
0 commit comments