From 8efb1e00b51c6e4f1cb0ed9b33ae61c7ac38c5e7 Mon Sep 17 00:00:00 2001 From: Miguel Elhaiek Date: Thu, 11 Apr 2024 15:08:50 -0300 Subject: [PATCH] Modifing time for health checks in target group --- terraform/alb.tf | 25 ++++++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) diff --git a/terraform/alb.tf b/terraform/alb.tf index 1447ea5..b77a418 100644 --- a/terraform/alb.tf +++ b/terraform/alb.tf @@ -34,6 +34,18 @@ resource "aws_lb" "vectorstore_nlb" { } +# resource "aws_security_group" "api_gateway_sg" { +# name = "api-gateway-sg" +# description = "Security group for API Gateway" +# vpc_id = aws_vpc.vectorstore_vpc.id + +# tags = { +# Name = "APIGatewaySG" +# } +# } + + + resource "aws_security_group" "nlb_sg" { name = "nlb-sg" @@ -57,6 +69,13 @@ resource "aws_security_group" "nlb_sg" { cidr_blocks = ["0.0.0.0/0"] } + # ingress { + # from_port = 80 + # to_port = 80 + # protocol = "tcp" + # security_groups = [aws_security_group.api_gateway_sg.id] # Reference the API Gateway's security group + # } + egress { from_port = 0 to_port = 0 @@ -81,10 +100,10 @@ resource "aws_lb_target_group" "ecs_target" { path = "/health" // Specify a path that your application responds to with HTTP 200 port = "traffic-port" // Use the traffic port interval = 120 - healthy_threshold = 4 - unhealthy_threshold = 2 + healthy_threshold = 2 + unhealthy_threshold = 3 matcher = "200" // Expect a 200 OK response for a healthy status - timeout = 110 + timeout = 100 } }