Skip to content
Snippets Groups Projects
Commit 680cb1e4 authored by Florian Warninghoff's avatar Florian Warninghoff
Browse files

HOLI-2939 add service_name to labels

parent 9550ffb0
No related branches found
No related tags found
No related merge requests found
......@@ -5,7 +5,7 @@
*/
resource "random_id" "main" {
byte_length = 2
prefix = "unified-api-${local.environment}-"
prefix = "${local.service_name}-${local.environment}-"
}
......@@ -82,6 +82,7 @@ resource "google_cloud_run_service" "unified_api" {
metadata {
labels = {
"environment" = local.environment
"service" = local.service_name
}
annotations = {
"autoscaling.knative.dev/minScale" = local.environment == "production" ? "1" : "0"
......
locals {
# predefined environment names are staging, production, and for any branch, its gitlab <CI_ENVIRONMENT_SLUG>
environment = terraform.workspace
service_name = "unified-api"
# the dns name can be at most 64 chars in total. The environment passed in via gitlab is max 24 chars (CI_ENVIRONMENT_SLUG).
dns_name = "${local.environment}.${data.terraform_remote_state.holi_unified_api_common_state.outputs.dns_unified_api_domain}"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment