-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathalb_target_group.tf
84 lines (75 loc) · 2.91 KB
/
alb_target_group.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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
resource "aws_lb_target_group" "resume-app-application-load-balancer-target-group" {
name = var.resume-app-application-load-balancer-target-group-name
port = 80 # Port on which EC2 instance listens
protocol = "HTTP"
vpc_id = aws_vpc.resume-app-vpc.id
health_check {
path = "/"
port = "traffic-port"
protocol = "HTTP"
interval = 30
timeout = 10
healthy_threshold = 2
unhealthy_threshold = 2
}
}
resource "aws_lb_target_group" "node-exporter-target-group" {
name = "node-exporter-target-group"
port = 9100 # Port on which Node Exporter listens for metrics
protocol = "HTTP" # Assuming Node Exporter serves metrics over HTTP
vpc_id = aws_vpc.resume-app-vpc.id
health_check {
path = "/metrics" # Endpoint path for Node Exporter metrics
port = "traffic-port" # Using traffic port for consistency, it equals above port
protocol = "HTTP" # Protocol for health checks
interval = 30
timeout = 10
healthy_threshold = 2
unhealthy_threshold = 2
}
}
resource "aws_lb_target_group" "prometheus-target-group" {
name = "prometheus-target-group"
port = 9090 # Port on which Prometheus operates
protocol = "HTTP"
vpc_id = aws_vpc.resume-app-vpc.id
health_check {
path = "/-/healthy" # Endpoint path for Prometheus health checks
port = "traffic-port" # Using traffic port for consistency, it equals above port
protocol = "HTTP" # Protocol for health checks
interval = 30
timeout = 10
healthy_threshold = 2
unhealthy_threshold = 2
}
}
resource "aws_lb_target_group" "grafana-target-group" {
name = "grafana-target-group"
port = 3000 # Port on which Grafana operates
protocol = "HTTP"
vpc_id = aws_vpc.resume-app-vpc.id
health_check {
path = "/api/health" # Endpoint path for Grafana health checks
port = "traffic-port" # Using traffic port for consistency, it equals above port
protocol = "HTTP" # Protocol for health checks
interval = 30
timeout = 10
healthy_threshold = 2
unhealthy_threshold = 2
}
}
resource "aws_lb_target_group" "alertmanager-target-group" {
name = "alertmanager-target-group"
port = 9093 # Port on which Alertmanager operates
protocol = "HTTP"
vpc_id = aws_vpc.resume-app-vpc.id
health_check {
path = "/-/healthy" # Endpoint path for Alertmanager health checks
port = "traffic-port" # Using traffic port for consistency, it equals above port
protocol = "HTTP" # Protocol for health checks
interval = 30
timeout = 10
healthy_threshold = 2
unhealthy_threshold = 2
}
}