From 4a200b2a11a2b34b61273001a3899e535aaeaf1b Mon Sep 17 00:00:00 2001 From: Gaetan BOGAERT Date: Mon, 7 Nov 2022 09:42:26 +0100 Subject: [PATCH] fix: location-policy permadrifting #1445 --- autogen/main/cluster.tf.tmpl | 1 + cluster.tf | 10 ++++++---- modules/beta-private-cluster-update-variant/cluster.tf | 10 ++++++---- modules/beta-private-cluster/cluster.tf | 10 ++++++---- modules/beta-public-cluster-update-variant/cluster.tf | 10 ++++++---- modules/beta-public-cluster/cluster.tf | 10 ++++++---- modules/private-cluster-update-variant/cluster.tf | 10 ++++++---- modules/private-cluster/cluster.tf | 10 ++++++---- 8 files changed, 43 insertions(+), 28 deletions(-) diff --git a/autogen/main/cluster.tf.tmpl b/autogen/main/cluster.tf.tmpl index f485dcb247..fd82bbd19f 100644 --- a/autogen/main/cluster.tf.tmpl +++ b/autogen/main/cluster.tf.tmpl @@ -631,6 +631,7 @@ resource "google_container_node_pool" "windows_pools" { content { min_node_count = lookup(autoscaling.value, "min_count", 1) max_node_count = lookup(autoscaling.value, "max_count", 100) + location_policy = lookup(autoscaling.value, "location_policy", null) } } diff --git a/cluster.tf b/cluster.tf index c9574e9218..c9d1bb41af 100644 --- a/cluster.tf +++ b/cluster.tf @@ -331,8 +331,9 @@ resource "google_container_node_pool" "pools" { dynamic "autoscaling" { for_each = lookup(each.value, "autoscaling", true) ? [each.value] : [] content { - min_node_count = lookup(autoscaling.value, "min_count", 1) - max_node_count = lookup(autoscaling.value, "max_count", 100) + min_node_count = lookup(autoscaling.value, "min_count", 1) + max_node_count = lookup(autoscaling.value, "max_count", 100) + location_policy = lookup(autoscaling.value, "location_policy", null) } } @@ -483,8 +484,9 @@ resource "google_container_node_pool" "windows_pools" { dynamic "autoscaling" { for_each = lookup(each.value, "autoscaling", true) ? [each.value] : [] content { - min_node_count = lookup(autoscaling.value, "min_count", 1) - max_node_count = lookup(autoscaling.value, "max_count", 100) + min_node_count = lookup(autoscaling.value, "min_count", 1) + max_node_count = lookup(autoscaling.value, "max_count", 100) + location_policy = lookup(autoscaling.value, "location_policy", null) } } diff --git a/modules/beta-private-cluster-update-variant/cluster.tf b/modules/beta-private-cluster-update-variant/cluster.tf index daad8f3295..a78fa3cdc9 100644 --- a/modules/beta-private-cluster-update-variant/cluster.tf +++ b/modules/beta-private-cluster-update-variant/cluster.tf @@ -549,8 +549,9 @@ resource "google_container_node_pool" "pools" { dynamic "autoscaling" { for_each = lookup(each.value, "autoscaling", true) ? [each.value] : [] content { - min_node_count = lookup(autoscaling.value, "min_count", 1) - max_node_count = lookup(autoscaling.value, "max_count", 100) + min_node_count = lookup(autoscaling.value, "min_count", 1) + max_node_count = lookup(autoscaling.value, "max_count", 100) + location_policy = lookup(autoscaling.value, "location_policy", null) } } @@ -754,8 +755,9 @@ resource "google_container_node_pool" "windows_pools" { dynamic "autoscaling" { for_each = lookup(each.value, "autoscaling", true) ? [each.value] : [] content { - min_node_count = lookup(autoscaling.value, "min_count", 1) - max_node_count = lookup(autoscaling.value, "max_count", 100) + min_node_count = lookup(autoscaling.value, "min_count", 1) + max_node_count = lookup(autoscaling.value, "max_count", 100) + location_policy = lookup(autoscaling.value, "location_policy", null) } } diff --git a/modules/beta-private-cluster/cluster.tf b/modules/beta-private-cluster/cluster.tf index de0f41ec0f..973e78dba0 100644 --- a/modules/beta-private-cluster/cluster.tf +++ b/modules/beta-private-cluster/cluster.tf @@ -458,8 +458,9 @@ resource "google_container_node_pool" "pools" { dynamic "autoscaling" { for_each = lookup(each.value, "autoscaling", true) ? [each.value] : [] content { - min_node_count = lookup(autoscaling.value, "min_count", 1) - max_node_count = lookup(autoscaling.value, "max_count", 100) + min_node_count = lookup(autoscaling.value, "min_count", 1) + max_node_count = lookup(autoscaling.value, "max_count", 100) + location_policy = lookup(autoscaling.value, "location_policy", null) } } @@ -662,8 +663,9 @@ resource "google_container_node_pool" "windows_pools" { dynamic "autoscaling" { for_each = lookup(each.value, "autoscaling", true) ? [each.value] : [] content { - min_node_count = lookup(autoscaling.value, "min_count", 1) - max_node_count = lookup(autoscaling.value, "max_count", 100) + min_node_count = lookup(autoscaling.value, "min_count", 1) + max_node_count = lookup(autoscaling.value, "max_count", 100) + location_policy = lookup(autoscaling.value, "location_policy", null) } } diff --git a/modules/beta-public-cluster-update-variant/cluster.tf b/modules/beta-public-cluster-update-variant/cluster.tf index f464068cff..4b1db5aaea 100644 --- a/modules/beta-public-cluster-update-variant/cluster.tf +++ b/modules/beta-public-cluster-update-variant/cluster.tf @@ -530,8 +530,9 @@ resource "google_container_node_pool" "pools" { dynamic "autoscaling" { for_each = lookup(each.value, "autoscaling", true) ? [each.value] : [] content { - min_node_count = lookup(autoscaling.value, "min_count", 1) - max_node_count = lookup(autoscaling.value, "max_count", 100) + min_node_count = lookup(autoscaling.value, "min_count", 1) + max_node_count = lookup(autoscaling.value, "max_count", 100) + location_policy = lookup(autoscaling.value, "location_policy", null) } } @@ -735,8 +736,9 @@ resource "google_container_node_pool" "windows_pools" { dynamic "autoscaling" { for_each = lookup(each.value, "autoscaling", true) ? [each.value] : [] content { - min_node_count = lookup(autoscaling.value, "min_count", 1) - max_node_count = lookup(autoscaling.value, "max_count", 100) + min_node_count = lookup(autoscaling.value, "min_count", 1) + max_node_count = lookup(autoscaling.value, "max_count", 100) + location_policy = lookup(autoscaling.value, "location_policy", null) } } diff --git a/modules/beta-public-cluster/cluster.tf b/modules/beta-public-cluster/cluster.tf index 3cc7330640..0bf245fc52 100644 --- a/modules/beta-public-cluster/cluster.tf +++ b/modules/beta-public-cluster/cluster.tf @@ -439,8 +439,9 @@ resource "google_container_node_pool" "pools" { dynamic "autoscaling" { for_each = lookup(each.value, "autoscaling", true) ? [each.value] : [] content { - min_node_count = lookup(autoscaling.value, "min_count", 1) - max_node_count = lookup(autoscaling.value, "max_count", 100) + min_node_count = lookup(autoscaling.value, "min_count", 1) + max_node_count = lookup(autoscaling.value, "max_count", 100) + location_policy = lookup(autoscaling.value, "location_policy", null) } } @@ -643,8 +644,9 @@ resource "google_container_node_pool" "windows_pools" { dynamic "autoscaling" { for_each = lookup(each.value, "autoscaling", true) ? [each.value] : [] content { - min_node_count = lookup(autoscaling.value, "min_count", 1) - max_node_count = lookup(autoscaling.value, "max_count", 100) + min_node_count = lookup(autoscaling.value, "min_count", 1) + max_node_count = lookup(autoscaling.value, "max_count", 100) + location_policy = lookup(autoscaling.value, "location_policy", null) } } diff --git a/modules/private-cluster-update-variant/cluster.tf b/modules/private-cluster-update-variant/cluster.tf index 7cf9af2da6..315265d189 100644 --- a/modules/private-cluster-update-variant/cluster.tf +++ b/modules/private-cluster-update-variant/cluster.tf @@ -435,8 +435,9 @@ resource "google_container_node_pool" "pools" { dynamic "autoscaling" { for_each = lookup(each.value, "autoscaling", true) ? [each.value] : [] content { - min_node_count = lookup(autoscaling.value, "min_count", 1) - max_node_count = lookup(autoscaling.value, "max_count", 100) + min_node_count = lookup(autoscaling.value, "min_count", 1) + max_node_count = lookup(autoscaling.value, "max_count", 100) + location_policy = lookup(autoscaling.value, "location_policy", null) } } @@ -588,8 +589,9 @@ resource "google_container_node_pool" "windows_pools" { dynamic "autoscaling" { for_each = lookup(each.value, "autoscaling", true) ? [each.value] : [] content { - min_node_count = lookup(autoscaling.value, "min_count", 1) - max_node_count = lookup(autoscaling.value, "max_count", 100) + min_node_count = lookup(autoscaling.value, "min_count", 1) + max_node_count = lookup(autoscaling.value, "max_count", 100) + location_policy = lookup(autoscaling.value, "location_policy", null) } } diff --git a/modules/private-cluster/cluster.tf b/modules/private-cluster/cluster.tf index 4c7955a9dd..1af16cc510 100644 --- a/modules/private-cluster/cluster.tf +++ b/modules/private-cluster/cluster.tf @@ -344,8 +344,9 @@ resource "google_container_node_pool" "pools" { dynamic "autoscaling" { for_each = lookup(each.value, "autoscaling", true) ? [each.value] : [] content { - min_node_count = lookup(autoscaling.value, "min_count", 1) - max_node_count = lookup(autoscaling.value, "max_count", 100) + min_node_count = lookup(autoscaling.value, "min_count", 1) + max_node_count = lookup(autoscaling.value, "max_count", 100) + location_policy = lookup(autoscaling.value, "location_policy", null) } } @@ -496,8 +497,9 @@ resource "google_container_node_pool" "windows_pools" { dynamic "autoscaling" { for_each = lookup(each.value, "autoscaling", true) ? [each.value] : [] content { - min_node_count = lookup(autoscaling.value, "min_count", 1) - max_node_count = lookup(autoscaling.value, "max_count", 100) + min_node_count = lookup(autoscaling.value, "min_count", 1) + max_node_count = lookup(autoscaling.value, "max_count", 100) + location_policy = lookup(autoscaling.value, "location_policy", null) } }