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