2018-06-19 07:56:32 +02:00
|
|
|
# Target groups of instances for use with load balancers
|
2017-11-08 06:56:50 +01:00
|
|
|
|
|
|
|
resource "aws_lb_target_group" "workers-http" {
|
2018-03-04 02:52:01 +01:00
|
|
|
name = "${var.name}-workers-http"
|
2018-02-27 07:16:34 +01:00
|
|
|
vpc_id = "${var.vpc_id}"
|
2017-11-08 06:56:50 +01:00
|
|
|
target_type = "instance"
|
|
|
|
|
|
|
|
protocol = "TCP"
|
|
|
|
port = 80
|
2017-09-18 06:40:33 +02:00
|
|
|
|
2018-04-16 02:21:49 +02:00
|
|
|
# HTTP health check for ingress
|
2017-09-18 06:40:33 +02:00
|
|
|
health_check {
|
2017-11-08 06:56:50 +01:00
|
|
|
protocol = "HTTP"
|
|
|
|
port = 10254
|
|
|
|
path = "/healthz"
|
|
|
|
|
|
|
|
# NLBs required to use same healthy and unhealthy thresholds
|
|
|
|
healthy_threshold = 3
|
|
|
|
unhealthy_threshold = 3
|
|
|
|
|
|
|
|
# Interval between health checks required to be 10 or 30
|
|
|
|
interval = 10
|
2017-09-18 06:40:33 +02:00
|
|
|
}
|
2017-11-08 06:56:50 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
resource "aws_lb_target_group" "workers-https" {
|
2018-03-04 02:52:01 +01:00
|
|
|
name = "${var.name}-workers-https"
|
2018-02-27 07:16:34 +01:00
|
|
|
vpc_id = "${var.vpc_id}"
|
2017-11-08 06:56:50 +01:00
|
|
|
target_type = "instance"
|
|
|
|
|
|
|
|
protocol = "TCP"
|
|
|
|
port = 443
|
2017-09-18 06:40:33 +02:00
|
|
|
|
2018-04-16 02:21:49 +02:00
|
|
|
# HTTP health check for ingress
|
2017-11-08 06:56:50 +01:00
|
|
|
health_check {
|
|
|
|
protocol = "HTTP"
|
|
|
|
port = 10254
|
|
|
|
path = "/healthz"
|
|
|
|
|
|
|
|
# NLBs required to use same healthy and unhealthy thresholds
|
|
|
|
healthy_threshold = 3
|
|
|
|
unhealthy_threshold = 3
|
|
|
|
|
|
|
|
# Interval between health checks required to be 10 or 30
|
|
|
|
interval = 10
|
|
|
|
}
|
2017-09-18 06:40:33 +02:00
|
|
|
}
|