diff --git a/terraform/environments/deployment.tf b/terraform/environments/deployment.tf index 766e63a635467225b0b2c0b63c411cbc4636e869..a2bb69da486ce168c855f0cf817e66981cd31c9b 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 ee27e81fe448b9a1a64d80bdfb8433f52e1a7090..b39087f0e25959347e3686c847e8250ae92b9d2f 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}"