From 3fa18ddf681d9d93f04659bdd4bba95d029e1bf7 Mon Sep 17 00:00:00 2001 From: Daniel Barnes Date: Thu, 12 Dec 2024 07:31:04 +0900 Subject: [PATCH] feat: Add additional label references --- main.tf | 1 + modules/app_gke/main.tf | 3 ++- modules/app_gke/variables.tf | 8 +++++++- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/main.tf b/main.tf index c9def791..d7dcbdcb 100644 --- a/main.tf +++ b/main.tf @@ -124,6 +124,7 @@ module "app_gke" { depends_on = [module.project_factory_project_services] max_node_count = local.max_node_count min_node_count = local.min_node_count + labels = var.labels } module "app_lb" { diff --git a/modules/app_gke/main.tf b/modules/app_gke/main.tf index 8e5cd769..f94c1ad4 100644 --- a/modules/app_gke/main.tf +++ b/modules/app_gke/main.tf @@ -5,7 +5,8 @@ locals { } resource "google_container_cluster" "default" { - name = "${var.namespace}-cluster" + name = "${var.namespace}-cluster" + resource_labels = var.labels network = var.network.self_link subnetwork = var.subnetwork.self_link diff --git a/modules/app_gke/variables.tf b/modules/app_gke/variables.tf index caa041ad..b8d788b3 100644 --- a/modules/app_gke/variables.tf +++ b/modules/app_gke/variables.tf @@ -3,6 +3,12 @@ variable "namespace" { description = "Friendly name prefix used for tagging and naming AWS resources." } +variable "labels" { + type = map(string) + description = "Labels to apply to resources" + default = {} +} + variable "service_account" { description = "The service account associated with the GKE cluster instances that host Weights & Biases." type = object({ email = string }) @@ -58,4 +64,4 @@ variable "deletion_protection" { description = "If the GKE Cluster should have deletion protection enabled. The GKE Cluster can't be deleted when this value is set to `true`." type = bool default = true -} \ No newline at end of file +}