-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnlb.tf
33 lines (31 loc) · 938 Bytes
/
nlb.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
# Network Load Balancer
resource "yandex_lb_network_load_balancer" "nlb" {
depends_on = [ yandex_compute_instance_group.ig-vm, yandex_lb_target_group.lbg-ingress ]
for_each = { for key, value in var.nlb_set: key => value }
name = each.value.nlb_name
listener {
name = each.value.app_list_name
port = each.value.app_port
target_port = each.value.app_tport
external_address_spec {
ip_version = "ipv4"
}
}
listener {
name = each.value.mon_list_name
port = each.value.mon_port
target_port = each.value.mon_tport
external_address_spec {
ip_version = "ipv4"
}
}
attached_target_group {
target_group_id = yandex_lb_target_group.lbg-ingress.id
healthcheck {
name = each.value.hc_name
tcp_options {
port = each.value.app_tport
}
}
}
}