Skip to content

Commit

Permalink
chore(infrastructure): toggle connection termination
Browse files Browse the repository at this point in the history
  • Loading branch information
luke-h1 committed Aug 28, 2024
1 parent 0ab19d2 commit 8f27532
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions terraform/lb.tf
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ resource "aws_default_subnet" "app_subnet_c" {
resource "aws_alb" "app_load_balancer" {
name = "${var.project_name}-${var.env}-lb"
load_balancer_type = "application"
connection {
timeout = "30"
}
subnets = [
aws_default_subnet.application_subnet_a.id,
aws_default_subnet.application_subnet_b.id,
Expand Down Expand Up @@ -61,17 +64,16 @@ resource "aws_lb_target_group" "app_target_group" {
tags = merge(var.tags, {
"Name" = "${var.project_name}-${var.env}-tg"
})
port = 80
protocol = "HTTP"
target_type = "ip"
vpc_id = aws_default_vpc.default_vpc.id
deregistration_delay = 300
load_balancing_algorithm_type = "least_outstanding_requests"

connection_termination = true
port = 80
protocol = "HTTP"
target_type = "ip"
vpc_id = aws_default_vpc.default_vpc.id
deregistration_delay = 30
health_check {
matcher = "200,301,302"
path = "/api/healthcheck"
interval = 60
interval = 120
timeout = 30
healthy_threshold = 3
}
Expand All @@ -95,7 +97,6 @@ resource "aws_lb_listener" "web_http" {
})
default_action {
type = "redirect"

redirect {
port = 443
protocol = "HTTPS"
Expand Down Expand Up @@ -145,6 +146,7 @@ resource "aws_security_group" "app_service_security_group" {
"Description" = "Security group for ${var.project_name}-${var.env}"
})


ingress {
from_port = 0
to_port = 0
Expand Down

0 comments on commit 8f27532

Please sign in to comment.