From 08425cc8869e988eaf833451e20d290c8a0acc19 Mon Sep 17 00:00:00 2001 From: Ole Langbehn <ole.langbehn@inoio.de> Date: Sat, 24 Aug 2024 01:28:48 +0200 Subject: [PATCH] NOISSUE add labels to functions and run services for monitoring&logging --- terraform/environments/deployment.tf | 4 ++++ terraform/environments/vars.tf | 1 + 2 files changed, 5 insertions(+) diff --git a/terraform/environments/deployment.tf b/terraform/environments/deployment.tf index 766e63a..a2bb69d 100644 --- a/terraform/environments/deployment.tf +++ b/terraform/environments/deployment.tf @@ -86,6 +86,10 @@ resource "google_cloud_run_service" "notifications_api" { # possible values: all-traffic/private-ranges-only(default) https://cloud.google.com/sdk/gcloud/reference/run/services/update#--vpc-egress "run.googleapis.com/vpc-access-egress" = "private-ranges-only" } + labels = { + "environment_type" = local.environment_type + "holi_service" = "notifications" + } } } diff --git a/terraform/environments/vars.tf b/terraform/environments/vars.tf index ee27e81..b39087f 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" # the dns name can be at most 64 chars in total dns_name = "${trimsuffix(substr(local.environment, 0, 34), ".-")}.${data.terraform_remote_state.holi_notifications_api_common_state.outputs.dns_notifications_api_domain}" -- GitLab