-
Notifications
You must be signed in to change notification settings - Fork 0
/
load_balancer.tf
32 lines (29 loc) · 960 Bytes
/
load_balancer.tf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
resource "aws_lb" "sensor_lb" {
name = var.sensor_asg_load_balancer_name
load_balancer_type = "gateway"
subnets = [data.aws_subnet.monitoring_subnet.id]
enable_cross_zone_load_balancing = true
}
resource "aws_lb_listener" "load_balancer_listener" {
load_balancer_arn = aws_lb.sensor_lb.arn
default_action {
type = "forward"
target_group_arn = aws_lb_target_group.health_check.arn
}
}
resource "aws_lb_target_group" "health_check" {
name = var.lb_health_check_target_group_name
vpc_id = data.aws_vpc.provided.id
protocol = "GENEVE"
port = 6081
target_type = "instance"
health_check {
enabled = true
protocol = "HTTP"
path = "/api/system/healthcheck"
port = 41080
interval = 60
healthy_threshold = 2
unhealthy_threshold = 10
}
}