Skip to content

Commit

Permalink
Merge pull request #4 from kesarevs/alb-idle-timeout
Browse files Browse the repository at this point in the history
Allow alb idle timeout customisation
  • Loading branch information
chrkv authored May 24, 2024
2 parents c5ac957 + 55f410e commit 94ffe74
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ module "loadbalancer" {
https_ports = [443]
http_ports = [80]
public_subnets = [module.vpc.subnet_public_1, module.vpc.subnet_public_2]
idle_timeout = 60
certificate_arn = module.alb_certificate.arn // see https://github.com/jetbrains-infra/terraform-aws-acm-certificate
access_log_bucket = module.s3_logs.bucket_id // see https://github.com/jetbrains-infra/terraform-aws-s3-bucket-for-logs
access_log_prefix = module.s3_logs.alb_logs_path
Expand Down
1 change: 1 addition & 0 deletions alb.tf
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ resource "aws_alb" "ingress" {
internal = local.internal
security_groups = [aws_security_group.alb.id]
subnets = local.public_subnets
idle_timeout = local.idle_timeout

dynamic "access_logs" {
for_each = local.access_logs_enable ? [""] : []
Expand Down
6 changes: 6 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,11 @@ variable "access_log_prefix" {
default = ""
}

variable "idle_timeout" {
description = "Connection idle timeout"
default = 60
}

data "aws_subnet" "public_1" {
id = local.public_subnets[0]
}
Expand All @@ -59,6 +64,7 @@ locals {
vpc_id = data.aws_subnet.public_1.vpc_id
target_cidr_blocks = var.target_cidr_blocks
alb_certificate_arn = var.certificate_arn
idle_timeout = var.idle_timeout

// magic to get map of port to listener arn pairs
listener_http_ports = aws_alb_listener.http.*.port
Expand Down

0 comments on commit 94ffe74

Please sign in to comment.