forked from Infra-Red/terraforming-pks-gcp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlb.tf
32 lines (28 loc) · 996 Bytes
/
lb.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
// Static IP address for forwarding rule
resource "google_compute_address" "pks-api-ip" {
name = "${var.env_prefix}-pks-api"
count = "${var.pks_lb_count}"
}
// PKS target pool
resource "google_compute_target_pool" "pks-api" {
name = "${var.env_prefix}-pks-api"
count = "${var.pks_lb_count}"
health_checks = []
}
// TCP forwarding rules
resource "google_compute_forwarding_rule" "pks-api-9021" {
name = "${var.env_prefix}-pks-api-9021"
count = "${var.pks_lb_count}"
target = "${google_compute_target_pool.pks-api.self_link}"
port_range = "9021"
ip_protocol = "TCP"
ip_address = "${google_compute_address.pks-api-ip.address}"
}
resource "google_compute_forwarding_rule" "pks-api-8443" {
name = "${var.env_prefix}-pks-api-8443"
count = "${var.pks_lb_count}"
target = "${google_compute_target_pool.pks-api.self_link}"
port_range = "8443"
ip_protocol = "TCP"
ip_address = "${google_compute_address.pks-api-ip.address}"
}