From aea74d101b7219769bbb0d1559d190f3b7f08182 Mon Sep 17 00:00:00 2001 From: Yury Bushmelev Date: Thu, 20 Jul 2023 00:55:19 +0800 Subject: [PATCH] feat!: allow to override compute instance labels (#311) Co-authored-by: Bharath KKB --- modules/compute_instance/main.tf | 2 +- modules/compute_instance/variables.tf | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/modules/compute_instance/main.tf b/modules/compute_instance/main.tf index baf28587..b68e91cb 100644 --- a/modules/compute_instance/main.tf +++ b/modules/compute_instance/main.tf @@ -50,7 +50,7 @@ resource "google_compute_instance_from_template" "compute_instance" { zone = var.zone == null ? data.google_compute_zones.available.names[count.index % length(data.google_compute_zones.available.names)] : var.zone deletion_protection = var.deletion_protection resource_policies = var.resource_policies - + labels = var.labels dynamic "network_interface" { for_each = local.network_interface diff --git a/modules/compute_instance/variables.tf b/modules/compute_instance/variables.tf index b4c31e76..df2435fc 100644 --- a/modules/compute_instance/variables.tf +++ b/modules/compute_instance/variables.tf @@ -116,3 +116,9 @@ variable "resource_policies" { type = list(string) default = [] } + +variable "labels" { + type = map(string) + description = "(Optional) Labels to override those from the template, provided as a map" + default = null +}