@@ -1403,6 +1403,47 @@ func TestAccContainerCluster_withMaintenanceExclusionWindow(t *testing.T) {
14031403 })
14041404}
14051405
1406+ func TestAccContainerCluster_deleteExclusionWindow (t * testing.T ) {
1407+ t .Parallel ()
1408+ cluster := fmt .Sprintf ("tf-test-cluster-%s" , randString (t , 10 ))
1409+ resourceName := "google_container_cluster.with_maintenance_exclusion_window"
1410+
1411+ vcrTest (t , resource.TestCase {
1412+ PreCheck : func () { testAccPreCheck (t ) },
1413+ Providers : testAccProviders ,
1414+ CheckDestroy : testAccCheckContainerClusterDestroyProducer (t ),
1415+ Steps : []resource.TestStep {
1416+ {
1417+ Config : testAccContainerCluster_withExclusion_DailyMaintenanceWindow (cluster , "2020-01-01T00:00:00Z" , "2020-01-02T00:00:00Z" ),
1418+ },
1419+ {
1420+ ResourceName : resourceName ,
1421+ ImportStateIdPrefix : "us-central1-a/" ,
1422+ ImportState : true ,
1423+ ImportStateVerify : true ,
1424+ },
1425+ {
1426+ Config : testAccContainerCluster_withExclusion_RecurringMaintenanceWindow (cluster , "2019-01-01T00:00:00Z" , "2019-01-02T00:00:00Z" , "2019-05-01T00:00:00Z" , "2019-05-02T00:00:00Z" ),
1427+ },
1428+ {
1429+ ResourceName : resourceName ,
1430+ ImportStateIdPrefix : "us-central1-a/" ,
1431+ ImportState : true ,
1432+ ImportStateVerify : true ,
1433+ },
1434+ {
1435+ Config : testAccContainerCluster_withExclusion_NoMaintenanceWindow (cluster , "2020-01-01T00:00:00Z" , "2020-01-02T00:00:00Z" ),
1436+ },
1437+ {
1438+ ResourceName : resourceName ,
1439+ ImportStateIdPrefix : "us-central1-a/" ,
1440+ ImportState : true ,
1441+ ImportStateVerify : true ,
1442+ },
1443+ },
1444+ })
1445+ }
1446+
14061447func TestAccContainerCluster_withIPAllocationPolicy_existingSecondaryRanges (t * testing.T ) {
14071448 t .Parallel ()
14081449
@@ -3697,6 +3738,25 @@ resource "google_container_cluster" "with_maintenance_exclusion_window" {
36973738` , clusterName , w1startTime , w1endTime , w1startTime , w1endTime , w2startTime , w2endTime )
36983739}
36993740
3741+ func testAccContainerCluster_withExclusion_NoMaintenanceWindow (clusterName string , w1startTime , w1endTime string ) string {
3742+
3743+ return fmt .Sprintf (`
3744+ resource "google_container_cluster" "with_maintenance_exclusion_window" {
3745+ name = "%s"
3746+ location = "us-central1-a"
3747+ initial_node_count = 1
3748+
3749+ maintenance_policy {
3750+ recurring_window {
3751+ start_time = "%s"
3752+ end_time = "%s"
3753+ recurrence = "FREQ=DAILY"
3754+ }
3755+ }
3756+ }
3757+ ` , clusterName , w1startTime , w1endTime )
3758+ }
3759+
37003760func testAccContainerCluster_withExclusion_DailyMaintenanceWindow (clusterName string , w1startTime , w1endTime string ) string {
37013761
37023762 return fmt .Sprintf (`
0 commit comments