diff --git a/infra/load-balancer.tf b/infra/load-balancer.tf index b5ea059..4a65d7e 100644 --- a/infra/load-balancer.tf +++ b/infra/load-balancer.tf @@ -14,15 +14,21 @@ resource "aws_lb" "alpha" { enable_deletion_protection = false } -# ECS services manage themselves when it comes to registering to the -# target group so we only need to provide the pool -#################################################################### +## ECS services manage themselves when it comes to registering to the +## target group so we only need to provide the pool +##################################################################### resource "aws_lb_target_group" "alpha_cluster" { name = "${var.athens_prefix}-alpha-cluster" port = 80 protocol = "HTTP" target_type = "ip" vpc_id = aws_vpc.athens_vpc.id + health_check { + path = "/" + matcher = "200-299" + port = 80 + interval = 60 + } } resource "aws_lb_listener" "http" { @@ -34,3 +40,4 @@ resource "aws_lb_listener" "http" { target_group_arn = aws_lb_target_group.alpha_cluster.arn } } +