From 119617768c74e6e7a8fa2237129aeda7427f809f Mon Sep 17 00:00:00 2001 From: Keir Badger Date: Fri, 17 May 2024 11:18:50 +0100 Subject: [PATCH] Update main.tf --- main.tf | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/main.tf b/main.tf index 31f9fad..45b1907 100644 --- a/main.tf +++ b/main.tf @@ -77,7 +77,8 @@ resource "aws_alb_target_group" "target_group" { } locals { - logical_service_name = "${var.env}-${replace(var.component_name, "/-service$/", "")}" + # logical_service_name = "${var.env}-${replace(var.component_name, "/-service$/", "")}" + logical_service_name = "${var.env == "live" && var.aws_account_alias == "" ? replace(var.component_name, "/-service$/", "") : "${var.env}-${replace(var.component_name, "/-service$/", "")}"}" # full_account_name = "${var.env == "live" ? "${var.aws_account_alias}prod" : "${var.aws_account_alias}dev"}" full_account_name = "${var.env == "live" ? (var.aws_account_alias == "" ? "" : "${var.aws_account_alias}prod.") : "${var.aws_account_alias}dev."}" backend_dns_domain = "${local.full_account_name}${var.backend_dns}"