-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathalb_target_group_attachment.tf
More file actions
30 lines (25 loc) · 1.58 KB
/
Copy pathalb_target_group_attachment.tf
File metadata and controls
30 lines (25 loc) · 1.58 KB
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
resource "aws_lb_target_group_attachment" "resume-app-attach-target-to-ec2" {
target_group_arn = aws_lb_target_group.resume-app-application-load-balancer-target-group.arn
target_id = aws_instance.resume-app-ec2-instance.id
port = 80
}
resource "aws_lb_target_group_attachment" "node-exporter-attach-target-to-ec2" {
target_group_arn = aws_lb_target_group.node-exporter-target-group.arn # Use Node Exporter target group ARN
target_id = aws_instance.resume-app-ec2-instance.id # ID of the EC2 instance
port = 9100 # Port on which Node Exporter serves metrics
}
resource "aws_lb_target_group_attachment" "prometheus-attach-target-to-ec2" {
target_group_arn = aws_lb_target_group.prometheus-target-group.arn # Use Prometheus target group ARN
target_id = aws_instance.resume-app-ec2-instance.id # ID of the EC2 instance
port = 9090 # Port on which Prometheus operates
}
resource "aws_lb_target_group_attachment" "grafana-attach-target-to-ec2" {
target_group_arn = aws_lb_target_group.grafana-target-group.arn # Use Grafana target group ARN
target_id = aws_instance.resume-app-ec2-instance.id # ID of the EC2 instance
port = 3000 # Port on which Grafana operates
}
resource "aws_lb_target_group_attachment" "alertmanager-attach-target-to-ec2" {
target_group_arn = aws_lb_target_group.alertmanager-target-group.arn # Use Alertmanager target group ARN
target_id = aws_instance.resume-app-ec2-instance.id # ID of the EC2 instance
port = 9093 # Port on which Alertmanager operates
}