Modular Regional TCP Load Balancer for GCE using target pool and forwarding rule.
module "gce-lb-fr" {
source = "GoogleCloudPlatform/lb/google"
region = "${var.region}"
name = "group1-lb"
service_port = "${module.mig1.service_port}"
target_tags = ["${module.mig1.target_tags}"]
}
Figure 1. diagram of terraform resources
google_compute_forwarding_rule.default
: TCP Forwarding rule to the service port on the instances.google_compute_target_pool.default
: The target pool created for the instance group.google_compute_http_health_check.default
: The health check for the instance group targeted at the service port.google_compute_firewall.default-lb-fw
: Firewall that allows traffic from anywhere to instances service port.