diff --git a/terraform/environments/function.tf b/terraform/environments/function.tf index bcd0c8465fd74edbc0358fc73425f093b1932f28..863fb6759c0dfbe6d27d122d362bd04fe67eebfc 100644 --- a/terraform/environments/function.tf +++ b/terraform/environments/function.tf @@ -74,6 +74,11 @@ resource "google_cloudfunctions2_function" "holi-chat-integration" { } } + labels = { + "environment_type" = local.environment_type + "holi_service" = "chat-integration" + } + # taken from https://github.com/hashicorp/terraform-provider-google/issues/1938#issuecomment-1229042663 lifecycle { replace_triggered_by = [ diff --git a/terraform/environments/vars.tf b/terraform/environments/vars.tf index de1465dcce36f9162c773c6053a710fa0711e2f8..0df18735f57b6a7505896caebcae485e43f2e143 100644 --- a/terraform/environments/vars.tf +++ b/terraform/environments/vars.tf @@ -2,6 +2,7 @@ locals { # predefined environment names are staging, production, and <branchname> environment = terraform.workspace environment_name = trim(substr(local.environment, 0, 22), ".-") # limits the length of the name that it fits constraints google imposes for some resources, e.g. project ids + environment_type = contains(["staging", "production"], local.environment) ? local.environment : "review" default_region = data.terraform_remote_state.holi_infra_state.outputs.default_region }