Internally-Facing Regional TCP/UDP Load Balancer on GCP
Reference
Requirements
Name | Version |
---|---|
terraform | >= 1.3, < 2.0 |
~> 4.54 |
Providers
Name | Version |
---|---|
~> 4.54 | |
google-beta | n/a |
Modules
No modules.
Resources
Name | Type |
---|---|
google-beta_google_compute_region_backend_service.this | resource |
google_compute_forwarding_rule.this | resource |
google_compute_health_check.this | resource |
Inputs
Name | Description | Type | Default | Required |
---|---|---|---|---|
all_ports | Forward all ports of the ip_protocol from the frontend to the backends. Needs to be null if ports are provided. | bool | null | no |
allow_global_access | (Optional) If true, clients can access ILB from all regions. By default false, only allow from the ILB's local region; useful if the ILB is a next hop of a route. | bool | false | no |
backends | Names of primary backend groups (IGs or IGMs). Typically use module.vmseries.instance_group_self_links here. | map(string) | n/a | yes |
connection_draining_timeout_sec | (Optional) Time for which instance will be drained (not accept new connections, but still work to finish started). | number | null | no |
connection_tracking_policy | Connection tracking policy settings. Following options are available: - mode - (Optional|string) PER_CONNECTION (default) or PER_SESSION - idle_timeout_sec - (Optional|number) Defaults to 600 seconds, can only be modified in specific conditions (see link below)- persistence_on_unhealthy_backends - (Optional|string) DEFAULT_FOR_PROTOCOL (default), ALWAYS_PERSIST or NEVER_PERSIST More information about supported configurations in conjunction with session_affinity is available in Internal TCP/UDP Load Balancing documentation. | map(any) | null | no |
disable_connection_drain_on_failover | (Optional) On failover or failback, this field indicates whether connection drain will be honored. Setting this to true has the following effect: connections to the old active pool are not drained. Connections to the new active pool use the timeout of 10 min (currently fixed). Setting to false has the following effect: both old and new connections will have a drain timeout of 10 min. This can be set to true only if the protocol is TCP. The default is false. | bool | null | no |
drop_traffic_if_unhealthy | (Optional) Used only when no healthy VMs are detected in the primary and backup instance groups. When set to true, traffic is dropped. When set to false, new connections are sent across all VMs in the primary group. The default is false. | bool | null | no |
failover_backends | (Optional) Names of failover backend groups (IGs or IGMs). Failover groups are ignored unless the primary groups do not meet collective health threshold. | map(string) | {} | no |
failover_ratio | (Optional) The value of the field must be in [0, 1]. If the ratio of the healthy VMs in the primary backend is at or below this number, traffic arriving at the load-balanced IP will be directed to the failover_backends. In case where 'failoverRatio' is not set or all the VMs in the backup backend are unhealthy, the traffic will be directed back to the primary backend in the force mode, where traffic will be spread to the healthy VMs with the best effort, or to all VMs when no VM is healthy. This field is only used with l4 load balancing. | number | null | no |
health_check | (Optional) Name of either the global google_compute_health_check or google_compute_region_health_check to use. Conflicts with health_check_port. | string | null | no |
health_check_port | (Optional) Port number for TCP healthchecking, default 22. This setting is ignored when health_check is provided. | number | 22 | no |
ip_address | n/a | any | null | no |
ip_protocol | The IP protocol for the frontend forwarding rule, valid values are TCP and UDP. | string | "TCP" | no |
name | Name of the load balancer (that is, both the forwarding rule and the backend service) | string | n/a | yes |
network | n/a | any | null | no |
ports | Which port numbers are forwarded to the backends (up to 5 ports). Conflicts with all_ports. | list(number) | [] | no |
project | The project to deploy to. If unset the default provider project is used. | string | null | no |
region | Region to create ILB in. | string | null | no |
session_affinity | Controls distribution of new connections (or fragmented UDP packets) from clients to the backends, can influence available connection tracking configurations. Valid values are: NONE (default), CLIENT_IP_NO_DESTINATION, CLIENT_IP, CLIENT_IP_PROTO, CLIENT_IP_PORT_PROTO. | string | null | no |
subnetwork | n/a | string | n/a | yes |
timeout_sec | (Optional) How many seconds to wait for the backend before dropping the connection. Default is 30 seconds. Valid range is [1, 86400]. | number | null | no |
Outputs
Name | Description |
---|---|
address | n/a |
forwarding_rule | n/a |