Last active
September 1, 2024 02:07
-
-
Save ben-x/23b23b74eb1d37e50450377b67b79f6a to your computer and use it in GitHub Desktop.
Load balancer. Part of multi-region-with-single-workload project
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
resource "aws_lb_target_group" "central_app_tg" { | |
name = "central-app-tg" | |
port = var.app_port | |
protocol = "HTTP" | |
target_type = "ip" | |
ip_address_type = "ipv4" | |
tags = var.tags | |
vpc_id = aws_vpc.main.id | |
health_check { | |
enabled = true | |
healthy_threshold = 2 | |
interval = 15 | |
protocol = "HTTP" | |
timeout = 10 | |
unhealthy_threshold = 2 | |
} | |
} | |
module "app_alb" { | |
source = "../../../common-modules/aws-alb" | |
allow_all_egress = true | |
enable_deletion_protection = false | |
idle_timeout_seconds = "60" | |
is_internal = false | |
name = "app-alb" | |
tags = var.tags | |
listener_config = { | |
http_port_80 = { | |
protocol = "HTTP" | |
port = "80" | |
} | |
http_port_443 = { | |
protocol = "HTTPS" | |
port = "443" | |
certificate_arn = var.dns_config.cert_arn | |
} | |
} | |
vpc = { | |
id = aws_vpc.main.id | |
cidr_block = aws_vpc.main.cidr_block | |
subnet_ids = local.public_subnet_ids | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment