Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions deploy/terraform/apps/starter/app_stack/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -588,6 +588,20 @@ module "api_service" {
health_check_healthy_threshold = var.api_health_check_healthy_threshold
deregistration_delay = var.api_deregistration_delay

# Container-level liveness so ECS reports Healthy/Unhealthy instead of "Unknown"
# and restarts a wedged task. The `noble` image ships no curl/wget, so we use
# bash's built-in /dev/tcp to confirm Kestrel is accepting connections on the
# container port; app-level health is already covered by the ALB probing
# /health/live above. REQUIRES the full `noble` image — the chiseled image has
# no shell, so rebuild the API image (deploy --build-api) before applying this.
container_health_check = {
command = ["CMD", "bash", "-c", "exec 3<>/dev/tcp/127.0.0.1/${var.api_container_port}"]
interval = 30
timeout = 5
retries = 3
start_period = 60
}

task_role_arn = aws_iam_role.api_task.arn

enable_circuit_breaker = var.api_enable_circuit_breaker
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,5 +89,7 @@ migrator_command = ["apply", "--seed"]
# Services (Fargate Spot for cost savings)
################################################################################

api_cpu = "1024" # 1 vCPU
api_memory = "2048" # 2 GB — Fargate's minimum memory for 1 vCPU
api_desired_count = 1
api_use_fargate_spot = true
Original file line number Diff line number Diff line change
Expand Up @@ -84,5 +84,7 @@ migrator_command = ["apply", "--seed"]
# Services (Fargate Spot for cost savings)
################################################################################

api_cpu = "1024" # 1 vCPU
api_memory = "2048" # 2 GB — Fargate's minimum memory for 1 vCPU
api_desired_count = 1
api_use_fargate_spot = true
Loading