@@ -996,6 +996,36 @@ func TestAccContainerCluster_withPrivateClusterConfigMissingCidrBlock_withAutopi
996996 })
997997}
998998
999+ func TestAccContainerCluster_withPrivateClusterConfigGlobalAccessEnabledOnly (t * testing.T ) {
1000+ t .Parallel ()
1001+
1002+ clusterName := fmt .Sprintf ("tf-test-cluster-%s" , acctest .RandString (t , 10 ))
1003+
1004+ acctest .VcrTest (t , resource.TestCase {
1005+ PreCheck : func () { acctest .AccTestPreCheck (t ) },
1006+ ProtoV5ProviderFactories : acctest .ProtoV5ProviderFactories (t ),
1007+ CheckDestroy : testAccCheckContainerClusterDestroyProducer (t ),
1008+ Steps : []resource.TestStep {
1009+ {
1010+ Config : testAccContainerCluster_withPrivateClusterConfigGlobalAccessEnabledOnly (clusterName , true ),
1011+ },
1012+ {
1013+ ResourceName : "google_container_cluster.with_private_cluster" ,
1014+ ImportState : true ,
1015+ ImportStateVerify : true ,
1016+ },
1017+ {
1018+ Config : testAccContainerCluster_withPrivateClusterConfigGlobalAccessEnabledOnly (clusterName , false ),
1019+ },
1020+ {
1021+ ResourceName : "google_container_cluster.with_private_cluster" ,
1022+ ImportState : true ,
1023+ ImportStateVerify : true ,
1024+ },
1025+ },
1026+ })
1027+ }
1028+
9991029func TestAccContainerCluster_withIntraNodeVisibility (t * testing.T ) {
10001030 t .Parallel ()
10011031
@@ -6754,6 +6784,22 @@ resource "google_container_cluster" "with_private_cluster" {
67546784` , containerNetName , clusterName , masterGlobalAccessEnabled )
67556785}
67566786
6787+ func testAccContainerCluster_withPrivateClusterConfigGlobalAccessEnabledOnly (clusterName string , masterGlobalAccessEnabled bool ) string {
6788+ return fmt .Sprintf (`
6789+ resource "google_container_cluster" "with_private_cluster" {
6790+ name = "%s"
6791+ location = "us-central1-a"
6792+ initial_node_count = 1
6793+ private_cluster_config {
6794+ enable_private_endpoint = false
6795+ master_global_access_config {
6796+ enabled = %t
6797+ }
6798+ }
6799+ }
6800+ ` , clusterName , masterGlobalAccessEnabled )
6801+ }
6802+
67576803func testAccContainerCluster_withShieldedNodes (clusterName string , enabled bool ) string {
67586804 return fmt .Sprintf (`
67596805resource "google_container_cluster" "with_shielded_nodes" {
0 commit comments