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
3 changes: 3 additions & 0 deletions modules/gwlb/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ module "gateway_load_balancer" {
listener_port = 6081
cross_zone_load_balancing = var.enable_cross_zone_load_balancing
ip_mode = var.ip_mode

// default tcp timeout 1 hour
tcp_idle_timeout = 3600
}

resource "aws_vpc_endpoint_service" "gwlb_endpoint_service" {
Expand Down
1 change: 1 addition & 0 deletions modules/load_balancer/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ resource "aws_lb_listener" "lb_listener" {
certificate_arn = var.certificate_arn
protocol = var.load_balancers_type != "gateway" ? var.load_balancer_protocol : null
port = var.load_balancers_type != "gateway" ? var.listener_port : null
tcp_idle_timeout_seconds = var.tcp_idle_timeout > 0 ? var.tcp_idle_timeout : null
default_action {
type = "forward"
target_group_arn = aws_lb_target_group.lb_target_group.arn
Expand Down
11 changes: 11 additions & 0 deletions modules/load_balancer/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,17 @@ variable "health_check_protocol" {
type = string
default = null
}

variable "tcp_idle_timeout" {
description = "The idle timeout of the load balancer."
type = number
default = null
validation {
condition = var.tcp_idle_timeout == null || (var.tcp_idle_timeout >= 60 && var.tcp_idle_timeout <= 6000)
error_message = "The tcp_idle_timeout value must be between 60 and 6000 seconds"
}
}

variable "ip_mode" {
type = string
description = "IP mode of AWS resources."
Expand Down