Use tags for UID and role parsing (#242)

* Apply tags to all applicable GCP resources

* Move GCP UID and role from VM metadata to labels

* Adjust Azure tags to be in line with GCP and AWS

* Dont rely on resource name to find resources

Signed-off-by: Daniel Weiße <dw@edgeless.systems>
This commit is contained in:
Daniel Weiße 2022-10-24 16:58:21 +02:00 committed by GitHub
parent c2814aeddb
commit b35b74b772
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
34 changed files with 344 additions and 360 deletions

View file

@ -16,6 +16,7 @@ resource "google_compute_instance_template" "template" {
name = local.name
machine_type = var.instance_type
tags = ["constellation-${var.uid}"]
labels = merge(var.labels, { constellation-role = local.role_dashed })
confidential_instance_config {
enable_confidential_compute = true
@ -41,8 +42,6 @@ resource "google_compute_instance_template" "template" {
metadata = {
kube-env = var.kube_env
constellation-uid = var.uid
constellation-role = var.role
serial-port-enable = var.debug ? "TRUE" : "FALSE"
}

View file

@ -13,6 +13,12 @@ variable "uid" {
description = "UID of the cluster. This is used for tags."
}
variable "labels" {
type = map(string)
default = {}
description = "Labels to apply to the instance group."
}
variable "instance_type" {
type = string
description = "Instance type for the nodes."