From 76b5657672c13a02cee42d2e99ef3deb7d619d3d Mon Sep 17 00:00:00 2001 From: Andriy Zahornyak Date: Tue, 19 Sep 2023 10:50:17 +0300 Subject: [PATCH] add additional alb connection --- main.tf | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/main.tf b/main.tf index 0d0f14e..9fb4201 100644 --- a/main.tf +++ b/main.tf @@ -135,7 +135,15 @@ resource "aws_ecs_service" "service" { } } + dynamic "load_balancer" { + for_each = { for k, v in var.container_definitions : k => v if try(v.target_group_arn_additional, null) != null } + content { + target_group_arn = load_balancer.value.target_group_arn_additional + container_name = load_balancer.value.container_name + container_port = load_balancer.value.containerPort_additional + } + } deployment_minimum_healthy_percent = var.deployment_minimum_healthy_percent deployment_maximum_percent = var.deployment_maximum_percent