|
|
|
|
@@ -10,6 +10,7 @@ This module allows managing a GCE Internal Load Balancer and integrates the forw
|
|
|
|
|
- [Multiple forwarding rules](#multiple-forwarding-rules)
|
|
|
|
|
- [Dual stack (IPv4 and IPv6)](#dual-stack-ipv4-and-ipv6)
|
|
|
|
|
- [PSC service attachments](#psc-service-attachments)
|
|
|
|
|
- [Regional health check](#regional-health-check)
|
|
|
|
|
- [End to end example](#end-to-end-example)
|
|
|
|
|
- [Deploying changes to load balancer configurations](#deploying-changes-to-load-balancer-configurations)
|
|
|
|
|
- [Issues](#issues)
|
|
|
|
|
@@ -280,6 +281,31 @@ module "ilb" {
|
|
|
|
|
# tftest modules=1 resources=7
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
### Regional health check
|
|
|
|
|
|
|
|
|
|
The `is_regional` flag in the `health_check_config` block allows creating a regional health check instead of a global one.
|
|
|
|
|
|
|
|
|
|
```hcl
|
|
|
|
|
module "ilb" {
|
|
|
|
|
source = "./fabric/modules/net-lb-int"
|
|
|
|
|
project_id = var.project_id
|
|
|
|
|
region = "europe-west1"
|
|
|
|
|
name = "ilb-test"
|
|
|
|
|
service_label = "ilb-test"
|
|
|
|
|
vpc_config = {
|
|
|
|
|
network = var.vpc.self_link
|
|
|
|
|
subnetwork = var.subnet.self_link
|
|
|
|
|
}
|
|
|
|
|
health_check_config = {
|
|
|
|
|
is_regional = true
|
|
|
|
|
http = {
|
|
|
|
|
port = 80
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
# tftest modules=1 resources=3
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
### End to end example
|
|
|
|
|
|
|
|
|
|
This example spins up a simple HTTP server and combines four modules:
|
|
|
|
|
@@ -374,10 +400,10 @@ One other issue is a `Provider produced inconsistent final plan` error which is
|
|
|
|
|
|
|
|
|
|
| name | description | type | required | default |
|
|
|
|
|
|---|---|:---:|:---:|:---:|
|
|
|
|
|
| [name](variables.tf#L202) | Name used for all resources. | <code>string</code> | ✓ | |
|
|
|
|
|
| [project_id](variables.tf#L207) | Project id where resources will be created. | <code>string</code> | ✓ | |
|
|
|
|
|
| [region](variables.tf#L212) | GCP region. | <code>string</code> | ✓ | |
|
|
|
|
|
| [vpc_config](variables.tf#L238) | VPC-level configuration. | <code title="object({ network = string subnetwork = string })">object({…})</code> | ✓ | |
|
|
|
|
|
| [name](variables.tf#L203) | Name used for all resources. | <code>string</code> | ✓ | |
|
|
|
|
|
| [project_id](variables.tf#L208) | Project id where resources will be created. | <code>string</code> | ✓ | |
|
|
|
|
|
| [region](variables.tf#L213) | GCP region. | <code>string</code> | ✓ | |
|
|
|
|
|
| [vpc_config](variables.tf#L239) | VPC-level configuration. | <code title="object({ network = string subnetwork = string })">object({…})</code> | ✓ | |
|
|
|
|
|
| [backend_service_config](variables.tf#L17) | Backend service level configuration. | <code title="object({ connection_draining_timeout_sec = optional(number) connection_tracking = optional(object({ idle_timeout_sec = optional(number) persist_conn_on_unhealthy = optional(string) track_per_session = optional(bool) })) enable_subsetting = optional(bool) failover_config = optional(object({ disable_conn_drain = optional(bool) drop_traffic_if_unhealthy = optional(bool) ratio = optional(number) })) log_sample_rate = optional(number) name = optional(string) description = optional(string, "Terraform managed.") protocol = optional(string, "UNSPECIFIED") session_affinity = optional(string) timeout_sec = optional(number) })">object({…})</code> | | <code>{}</code> |
|
|
|
|
|
| [backends](variables.tf#L53) | Load balancer backends. | <code title="list(object({ group = string description = optional(string, "Terraform managed.") failover = optional(bool, false) }))">list(object({…}))</code> | | <code>[]</code> |
|
|
|
|
|
| [context](variables.tf#L64) | Context-specific interpolations. | <code title="object({ addresses = optional(map(string), {}) locations = optional(map(string), {}) networks = optional(map(string), {}) project_ids = optional(map(string), {}) subnets = optional(map(string), {}) })">object({…})</code> | | <code>{}</code> |
|
|
|
|
|
@@ -385,10 +411,10 @@ One other issue is a `Provider produced inconsistent final plan` error which is
|
|
|
|
|
| [forwarding_rules_config](variables.tf#L83) | The optional forwarding rules configuration. | <code title="map(object({ address = optional(string) description = optional(string) global_access = optional(bool, true) ipv6 = optional(bool, false) name = optional(string) ports = optional(list(string), null) protocol = optional(string, "TCP") }))">map(object({…}))</code> | | <code title="{ "" = {} }">{…}</code> |
|
|
|
|
|
| [group_configs](variables.tf#L99) | Optional unmanaged groups to create. Can be referenced in backends via outputs. | <code title="map(object({ zone = string name = optional(string) description = optional(string, "Terraform managed.") instances = optional(list(string)) named_ports = optional(map(number), {}) }))">map(object({…}))</code> | | <code>{}</code> |
|
|
|
|
|
| [health_check](variables.tf#L112) | Name of existing health check to use, disables auto-created health check. Also set `health_check_config = null` when cross-referencing an health check from another load balancer module to avoid a Terraform error. | <code>string</code> | | <code>null</code> |
|
|
|
|
|
| [health_check_config](variables.tf#L118) | Optional auto-created health check configuration, use the output self-link to set it in the auto healing policy. Refer to examples for usage. | <code title="object({ check_interval_sec = optional(number) description = optional(string, "Terraform managed.") enable_logging = optional(bool, false) healthy_threshold = optional(number) name = optional(string) timeout_sec = optional(number) unhealthy_threshold = optional(number) grpc = optional(object({ port = optional(number) port_name = optional(string) port_specification = optional(string) # USE_FIXED_PORT USE_NAMED_PORT USE_SERVING_PORT service_name = optional(string) })) http = optional(object({ host = optional(string) port = optional(number) port_name = optional(string) port_specification = optional(string) # USE_FIXED_PORT USE_NAMED_PORT USE_SERVING_PORT proxy_header = optional(string) request_path = optional(string) response = optional(string) })) http2 = optional(object({ host = optional(string) port = optional(number) port_name = optional(string) port_specification = optional(string) # USE_FIXED_PORT USE_NAMED_PORT USE_SERVING_PORT proxy_header = optional(string) request_path = optional(string) response = optional(string) })) https = optional(object({ host = optional(string) port = optional(number) port_name = optional(string) port_specification = optional(string) # USE_FIXED_PORT USE_NAMED_PORT USE_SERVING_PORT proxy_header = optional(string) request_path = optional(string) response = optional(string) })) tcp = optional(object({ port = optional(number) port_name = optional(string) port_specification = optional(string) # USE_FIXED_PORT USE_NAMED_PORT USE_SERVING_PORT proxy_header = optional(string) request = optional(string) response = optional(string) })) ssl = optional(object({ port = optional(number) port_name = optional(string) port_specification = optional(string) # USE_FIXED_PORT USE_NAMED_PORT USE_SERVING_PORT proxy_header = optional(string) request = optional(string) response = optional(string) })) })">object({…})</code> | | <code title="{ tcp = { port_specification = "USE_SERVING_PORT" } }">{…}</code> |
|
|
|
|
|
| [labels](variables.tf#L196) | Labels set on resources. | <code>map(string)</code> | | <code>{}</code> |
|
|
|
|
|
| [service_attachments](variables.tf#L217) | PSC service attachments, keyed by forwarding rule. | <code title="map(object({ nat_subnets = list(string) automatic_connection = optional(bool, false) consumer_accept_lists = optional(map(string), {}) consumer_reject_lists = optional(list(string)) description = optional(string) domain_name = optional(string) enable_proxy_protocol = optional(bool, false) reconcile_connections = optional(bool) }))">map(object({…}))</code> | | <code>null</code> |
|
|
|
|
|
| [service_label](variables.tf#L232) | Optional prefix of the fully qualified forwarding rule name. | <code>string</code> | | <code>null</code> |
|
|
|
|
|
| [health_check_config](variables.tf#L118) | Optional auto-created health check configuration, use the output self-link to set it in the auto healing policy. Refer to examples for usage. | <code title="object({ check_interval_sec = optional(number) description = optional(string, "Terraform managed.") enable_logging = optional(bool, false) healthy_threshold = optional(number) is_regional = optional(bool, false) name = optional(string) timeout_sec = optional(number) unhealthy_threshold = optional(number) grpc = optional(object({ port = optional(number) port_name = optional(string) port_specification = optional(string) # USE_FIXED_PORT USE_NAMED_PORT USE_SERVING_PORT service_name = optional(string) })) http = optional(object({ host = optional(string) port = optional(number) port_name = optional(string) port_specification = optional(string) # USE_FIXED_PORT USE_NAMED_PORT USE_SERVING_PORT proxy_header = optional(string) request_path = optional(string) response = optional(string) })) http2 = optional(object({ host = optional(string) port = optional(number) port_name = optional(string) port_specification = optional(string) # USE_FIXED_PORT USE_NAMED_PORT USE_SERVING_PORT proxy_header = optional(string) request_path = optional(string) response = optional(string) })) https = optional(object({ host = optional(string) port = optional(number) port_name = optional(string) port_specification = optional(string) # USE_FIXED_PORT USE_NAMED_PORT USE_SERVING_PORT proxy_header = optional(string) request_path = optional(string) response = optional(string) })) tcp = optional(object({ port = optional(number) port_name = optional(string) port_specification = optional(string) # USE_FIXED_PORT USE_NAMED_PORT USE_SERVING_PORT proxy_header = optional(string) request = optional(string) response = optional(string) })) ssl = optional(object({ port = optional(number) port_name = optional(string) port_specification = optional(string) # USE_FIXED_PORT USE_NAMED_PORT USE_SERVING_PORT proxy_header = optional(string) request = optional(string) response = optional(string) })) })">object({…})</code> | | <code title="{ tcp = { port_specification = "USE_SERVING_PORT" } }">{…}</code> |
|
|
|
|
|
| [labels](variables.tf#L197) | Labels set on resources. | <code>map(string)</code> | | <code>{}</code> |
|
|
|
|
|
| [service_attachments](variables.tf#L218) | PSC service attachments, keyed by forwarding rule. | <code title="map(object({ nat_subnets = list(string) automatic_connection = optional(bool, false) consumer_accept_lists = optional(map(string), {}) consumer_reject_lists = optional(list(string)) description = optional(string) domain_name = optional(string) enable_proxy_protocol = optional(bool, false) reconcile_connections = optional(bool) }))">map(object({…}))</code> | | <code>null</code> |
|
|
|
|
|
| [service_label](variables.tf#L233) | Optional prefix of the fully qualified forwarding rule name. | <code>string</code> | | <code>null</code> |
|
|
|
|
|
|
|
|
|
|
## Outputs
|
|
|
|
|
|
|
|
|
|
@@ -403,8 +429,8 @@ One other issue is a `Provider produced inconsistent final plan` error which is
|
|
|
|
|
| [group_self_links](outputs.tf#L57) | Optional unmanaged instance group self links. | |
|
|
|
|
|
| [groups](outputs.tf#L64) | Optional unmanaged instance group resources. | |
|
|
|
|
|
| [health_check](outputs.tf#L69) | Auto-created health-check resource. | |
|
|
|
|
|
| [health_check_id](outputs.tf#L74) | Auto-created health-check id. | |
|
|
|
|
|
| [health_check_self_link](outputs.tf#L79) | Auto-created health-check self link. | |
|
|
|
|
|
| [id](outputs.tf#L84) | Fully qualified forwarding rule ids. | |
|
|
|
|
|
| [service_attachment_ids](outputs.tf#L92) | Service attachment ids. | |
|
|
|
|
|
| [health_check_id](outputs.tf#L78) | Auto-created health-check id. | |
|
|
|
|
|
| [health_check_self_link](outputs.tf#L87) | Auto-created health-check self link. | |
|
|
|
|
|
| [id](outputs.tf#L96) | Fully qualified forwarding rule ids. | |
|
|
|
|
|
| [service_attachment_ids](outputs.tf#L104) | Service attachment ids. | |
|
|
|
|
|
<!-- END TFDOC -->
|
|
|
|
|
|