From 65805ca1bdd4365a72e838a22a47400ce7c32380 Mon Sep 17 00:00:00 2001 From: cmalpe <106224283+cmalpe@users.noreply.github.com> Date: Thu, 18 Apr 2024 14:59:33 +0530 Subject: [PATCH 1/2] added missing option for exclusion scope --- modules/gke-cluster-standard/main.tf | 3 +++ 1 file changed, 3 insertions(+) diff --git a/modules/gke-cluster-standard/main.tf b/modules/gke-cluster-standard/main.tf index 47998a6335..a6f0432d55 100644 --- a/modules/gke-cluster-standard/main.tf +++ b/modules/gke-cluster-standard/main.tf @@ -338,6 +338,9 @@ resource "google_container_cluster" "cluster" { exclusion_name = exclusion.value.name start_time = exclusion.value.start_time end_time = exclusion.value.end_time + exclusion_options { + scope = exclusion.value.scope + } } } } From 0720635672c6e351eebb1b0bea8e09063eb1deff Mon Sep 17 00:00:00 2001 From: cmalpe Date: Thu, 18 Apr 2024 10:54:10 +0000 Subject: [PATCH 2/2] added validation and changes for gke autopilot --- modules/gke-cluster-autopilot/main.tf | 6 ++++++ modules/gke-cluster-standard/main.tf | 7 +++++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/modules/gke-cluster-autopilot/main.tf b/modules/gke-cluster-autopilot/main.tf index d401a9752e..825c8739e5 100644 --- a/modules/gke-cluster-autopilot/main.tf +++ b/modules/gke-cluster-autopilot/main.tf @@ -177,6 +177,12 @@ resource "google_container_cluster" "cluster" { exclusion_name = exclusion.value.name start_time = exclusion.value.start_time end_time = exclusion.value.end_time + dynamic "exclusion_options" { + for_each = exclusion.value.scope != null ? [""] : [] + content { + scope = exclusion.value.scope + } + } } } } diff --git a/modules/gke-cluster-standard/main.tf b/modules/gke-cluster-standard/main.tf index a6f0432d55..6ab4c9d881 100644 --- a/modules/gke-cluster-standard/main.tf +++ b/modules/gke-cluster-standard/main.tf @@ -338,8 +338,11 @@ resource "google_container_cluster" "cluster" { exclusion_name = exclusion.value.name start_time = exclusion.value.start_time end_time = exclusion.value.end_time - exclusion_options { - scope = exclusion.value.scope + dynamic "exclusion_options" { + for_each = exclusion.value.scope != null ? [""] : [] + content { + scope = exclusion.value.scope + } } } }