Skip to content

Commit f59ea25

Browse files
committed
feat: implement labels variables
1 parent bfbe90f commit f59ea25

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

main.tf

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -89,9 +89,10 @@ resource "google_compute_instance" "main" {
8989
block-project-ssh-keys = true
9090
}
9191

92-
labels = {
93-
container-vm = module.gce_container_sqlproxy.vm_container_label
94-
}
92+
labels = merge(
93+
{ container-vm = module.gce_container_sqlproxy.vm_container_label },
94+
var.labels
95+
)
9596

9697
tags = [
9798
local.network_tag

variables.tf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,3 +70,9 @@ variable "allow_public_ip" {
7070
type = bool
7171
default = false
7272
}
73+
74+
variable "labels" {
75+
description = "A set of key/value label pairs to assign to the vm."
76+
type = map(string)
77+
default = {}
78+
}

0 commit comments

Comments
 (0)