From 5adb35ef75c2c62ea53d77e48d14e1b30887eff8 Mon Sep 17 00:00:00 2001 From: Tataihono Nikora Date: Fri, 16 Jan 2026 03:43:40 +0000 Subject: [PATCH] Add health check matcher support to ECS task module - Add health_check_matcher as optional variable (default: "200") - Apply matcher to ALB target group resource - Update CMS service config to use "204" matcher --- apps/cms/infrastructure/locals.tf | 3 ++- infrastructure/modules/aws/ecs-task/main.tf | 1 + infrastructure/modules/aws/ecs-task/variables.tf | 1 + 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/apps/cms/infrastructure/locals.tf b/apps/cms/infrastructure/locals.tf index d759bb98b98..7b7e1f03cd5 100644 --- a/apps/cms/infrastructure/locals.tf +++ b/apps/cms/infrastructure/locals.tf @@ -28,7 +28,8 @@ locals { dns_name = var.ecs_config.alb.dns_name } alb_target_group = merge(var.ecs_config.alb_target_group, { - port = local.port + port = local.port + health_check_matcher = "204" }) auto_scaling = { max_capacity = 4 diff --git a/infrastructure/modules/aws/ecs-task/main.tf b/infrastructure/modules/aws/ecs-task/main.tf index c1fda67e5db..6aa0c49c259 100644 --- a/infrastructure/modules/aws/ecs-task/main.tf +++ b/infrastructure/modules/aws/ecs-task/main.tf @@ -275,6 +275,7 @@ resource "aws_alb_target_group" "alb_target_group" { path = var.service_config.alb_target_group.health_check_path port = var.service_config.alb_target_group.health_check_port protocol = var.service_config.alb_target_group.protocol + matcher = var.service_config.alb_target_group.health_check_matcher } lifecycle { diff --git a/infrastructure/modules/aws/ecs-task/variables.tf b/infrastructure/modules/aws/ecs-task/variables.tf index b02e6cf70c0..c102ba77144 100644 --- a/infrastructure/modules/aws/ecs-task/variables.tf +++ b/infrastructure/modules/aws/ecs-task/variables.tf @@ -34,6 +34,7 @@ variable "service_config" { health_check_timeout = optional(number, 4) health_check_healthy_threshold = optional(number, 2) health_check_unhealthy_threshold = optional(number, 4) + health_check_matcher = optional(string, "200") }) auto_scaling = object({