diff --git a/ecs_fargate/ecs.tf b/ecs_fargate/ecs.tf index c612190..03c9cc0 100644 --- a/ecs_fargate/ecs.tf +++ b/ecs_fargate/ecs.tf @@ -23,7 +23,7 @@ locals { } volumesFrom : lookup(t, "volumesFrom", []) mountPoints : lookup(t, "mountPoints", []) - dependsOn : lookup(t, "dependsOn", []) + dependsOn : lookup(t, "dependsOn", []) cpu : 0 } diff --git a/ecs_fargate/networking.tf b/ecs_fargate/networking.tf index 47176c8..1727066 100644 --- a/ecs_fargate/networking.tf +++ b/ecs_fargate/networking.tf @@ -4,7 +4,7 @@ data "aws_lb" "alb" { } data "aws_lb_listener" "selected" { - count = data.aws_lb.alb != null ? 1 : 0 + count = var.ec2_alb_arn != null ? 1 : 0 load_balancer_arn = data.aws_lb.alb[0].arn port = coalesce(var.lb_listener_port, 443) } @@ -32,10 +32,10 @@ resource "aws_lb_target_group" "alb" { resource "aws_lb_listener_rule" "static" { depends_on = [aws_lb_target_group.alb] - for_each = length(coalesce(var.ecs_load_balancers, {})) != 0 ? var.ecs_load_balancers : {} + for_each = length(coalesce(var.ecs_load_balancers, {})) != 0 ? var.ecs_load_balancers : {} listener_arn = data.aws_lb_listener.selected[0].arn - tags = {} + tags = {} action { type = "forward" diff --git a/ecs_fargate/variables.tf b/ecs_fargate/variables.tf index 7715c55..fd83c2b 100644 --- a/ecs_fargate/variables.tf +++ b/ecs_fargate/variables.tf @@ -165,8 +165,10 @@ variable "ecs_load_balancers" { description = "Connect service to load balancer" type = map(object( { - container_port = number - tls = bool + container_port = number + tls = bool + health_check_path = optional(string) + health_check_matcher = optional(string) conditions = optional(object({ host_header = optional(list(string)) path_pattern = optional(list(string))