From 735c5cd8050b61ceb3fde0693ccd5a23190f869a Mon Sep 17 00:00:00 2001 From: Josh Gamache Date: Fri, 14 Jul 2023 14:50:27 -0600 Subject: [PATCH 1/5] chore: ignore vscode config file --- .gitignore | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.gitignore b/.gitignore index 1126bff..6ea33f9 100644 --- a/.gitignore +++ b/.gitignore @@ -30,3 +30,6 @@ mock-user-data.log # Ignore Terraform lock files, as we want to test the Terraform code in these repos with the latest provider # versions. .terraform.lock.hcl + +# Ignore VSCode personalization config +.vscode/settings.json From a0fe1c4299e41639336ba89f6b92e3caa829c042 Mon Sep 17 00:00:00 2001 From: Josh Gamache Date: Fri, 14 Jul 2023 14:53:11 -0600 Subject: [PATCH 2/5] chore: bump required version to match latest --- modules/gke-cluster/main.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/gke-cluster/main.tf b/modules/gke-cluster/main.tf index fa38889..b4fa6ba 100644 --- a/modules/gke-cluster/main.tf +++ b/modules/gke-cluster/main.tf @@ -7,7 +7,7 @@ terraform { # This module is now only being tested with Terraform 1.0.x. However, to make upgrading easier, we are setting # 0.12.26 as the minimum version, as that version added support for required_providers with source URLs, making it # forwards compatible with 1.0.x code. - required_version = ">= 0.12.26" + required_version = ">= 1.4.6" } locals { From fbbc194ceaef5afc627cb4fa75c70769ca0a2268 Mon Sep 17 00:00:00 2001 From: Josh Gamache Date: Fri, 14 Jul 2023 14:54:39 -0600 Subject: [PATCH 3/5] chore!: remove depreciated attribute - no longer in use as of GKE 1.19, currently at 1.26 --- modules/gke-cluster/main.tf | 5 ----- 1 file changed, 5 deletions(-) diff --git a/modules/gke-cluster/main.tf b/modules/gke-cluster/main.tf index b4fa6ba..1cdf7a8 100644 --- a/modules/gke-cluster/main.tf +++ b/modules/gke-cluster/main.tf @@ -104,11 +104,6 @@ resource "google_container_cluster" "cluster" { enabled = var.enable_vertical_pod_autoscaling } - master_auth { - username = var.basic_auth_username - password = var.basic_auth_password - } - dynamic "master_authorized_networks_config" { for_each = var.master_authorized_networks_config content { From 27a07dba3b6ec36d4d4fb4b0ff3fcf3344f12959 Mon Sep 17 00:00:00 2001 From: Josh Gamache Date: Mon, 17 Jul 2023 07:51:29 -0600 Subject: [PATCH 4/5] chore!: remove depricated attribute - see https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/container_cluster#workload_identity_config for info --- modules/gke-cluster/main.tf | 14 -------------- modules/gke-cluster/variables.tf | 12 ------------ 2 files changed, 26 deletions(-) diff --git a/modules/gke-cluster/main.tf b/modules/gke-cluster/main.tf index 1cdf7a8..7230f97 100644 --- a/modules/gke-cluster/main.tf +++ b/modules/gke-cluster/main.tf @@ -10,12 +10,6 @@ terraform { required_version = ">= 1.4.6" } -locals { - workload_identity_config = !var.enable_workload_identity ? [] : var.identity_namespace == null ? [{ - identity_namespace = "${var.project}.svc.id.goog" }] : [{ identity_namespace = var.identity_namespace - }] -} - # --------------------------------------------------------------------------------------------------------------------- # Create the GKE Cluster # We want to make a cluster with no node pools, and manage them all with the fine-grained google_container_node_pool resource @@ -154,14 +148,6 @@ resource "google_container_cluster" "cluster" { } } - dynamic "workload_identity_config" { - for_each = local.workload_identity_config - - content { - identity_namespace = workload_identity_config.value.identity_namespace - } - } - resource_labels = var.resource_labels } diff --git a/modules/gke-cluster/variables.tf b/modules/gke-cluster/variables.tf index c441061..aa35c67 100644 --- a/modules/gke-cluster/variables.tf +++ b/modules/gke-cluster/variables.tf @@ -215,15 +215,3 @@ variable "services_secondary_range_name" { type = string default = null } - -variable "enable_workload_identity" { - description = "Enable Workload Identity on the cluster" - default = false - type = bool -} - -variable "identity_namespace" { - description = "Workload Identity Namespace. Default sets project based namespace [project_id].svc.id.goog" - default = null - type = string -} From 221aa5378e164dbe781e54e9160f7baf09b08d5a Mon Sep 17 00:00:00 2001 From: Josh Gamache Date: Mon, 17 Jul 2023 13:39:34 -0600 Subject: [PATCH 5/5] chore: bump provider versions to latest --- modules/gke-cluster/main.tf | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/modules/gke-cluster/main.tf b/modules/gke-cluster/main.tf index 7230f97..5772cf9 100644 --- a/modules/gke-cluster/main.tf +++ b/modules/gke-cluster/main.tf @@ -8,6 +8,18 @@ terraform { # 0.12.26 as the minimum version, as that version added support for required_providers with source URLs, making it # forwards compatible with 1.0.x code. required_version = ">= 1.4.6" + + required_providers { + google = { + source = "hashicorp/google" + version = "~> 4.73.1" + } + google-beta = { + source = "hashicorp/google-beta" + version = "~> 4.73.1" + } + } + } # ---------------------------------------------------------------------------------------------------------------------