From b6f0894ad5b31e8e28f2f29a41a874e849e8fb81 Mon Sep 17 00:00:00 2001 From: William Shelley Date: Mon, 2 Dec 2024 13:21:58 +0000 Subject: [PATCH] fix: 5936 lb toggle on ecs service (#494) * fix: lb toggle on ecs service * fix: trying diff format * fix: testing null * fix: test lb empty --- infra/terraform/modules/service/ecs.tf | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/infra/terraform/modules/service/ecs.tf b/infra/terraform/modules/service/ecs.tf index baad41a276..34a36e47ec 100644 --- a/infra/terraform/modules/service/ecs.tf +++ b/infra/terraform/modules/service/ecs.tf @@ -129,14 +129,13 @@ module "ecs_service" { memory_reservation = 100 } } - - load_balancer = { + load_balancer = var.services[each.key].listener_rule_enable ? { service = { target_group_arn = aws_lb_target_group.this[each.key].arn container_name = each.key container_port = 8080 } - } + } : {} create_security_group = false security_group_ids = var.services[each.key].security_group_ids