fix #1055 for net-ilb-l7
This commit is contained in:
parent
ba8d14afb5
commit
7c95b7ce43
|
@ -246,11 +246,13 @@ module "ilb-l7" {
|
|||
my-neg = {
|
||||
gce = {
|
||||
zone = "europe-west1-b"
|
||||
endpoints = [{
|
||||
instance = "test-1"
|
||||
ip_address = "10.0.0.10"
|
||||
port = 80
|
||||
}]
|
||||
endpoints = {
|
||||
e-0 = {
|
||||
instance = "test-1"
|
||||
ip_address = "10.0.0.10"
|
||||
port = 80
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -283,10 +285,12 @@ module "ilb-l7" {
|
|||
my-neg = {
|
||||
hybrid = {
|
||||
zone = "europe-west1-b"
|
||||
endpoints = [{
|
||||
ip_address = "10.0.0.10"
|
||||
port = 80
|
||||
}]
|
||||
endpoints = {
|
||||
e-0 = {
|
||||
ip_address = "10.0.0.10"
|
||||
port = 80
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -512,20 +516,24 @@ module "ilb-l7" {
|
|||
neg-nginx-ew8-c = {
|
||||
gce = {
|
||||
zone = "europe-west8-c"
|
||||
endpoints = [{
|
||||
instance = "nginx-ew8-c"
|
||||
ip_address = "10.24.32.26"
|
||||
port = 80
|
||||
}]
|
||||
endpoints = {
|
||||
e-0 = {
|
||||
instance = "nginx-ew8-c"
|
||||
ip_address = "10.24.32.26"
|
||||
port = 80
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
neg-home-hello = {
|
||||
hybrid = {
|
||||
zone = "europe-west8-b"
|
||||
endpoints = [{
|
||||
ip_address = "192.168.0.3"
|
||||
port = 443
|
||||
}]
|
||||
endpoints = {
|
||||
e-0 = {
|
||||
ip_address = "192.168.0.3"
|
||||
port = 443
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -597,7 +605,7 @@ module "ilb-l7" {
|
|||
| [group_configs](variables.tf#L36) | Optional unmanaged groups to create. Can be referenced in backends via key or outputs. | <code title="map(object({ zone = string instances = optional(list(string), []) named_ports = optional(map(number), {}) project_id = optional(string) }))">map(object({…}))</code> | | <code>{}</code> |
|
||||
| [health_check_configs](variables-health-check.tf#L19) | Optional auto-created health check configurations, use the output self-link to set it in the auto healing policy. Refer to examples for usage. | <code title="map(object({ check_interval_sec = optional(number) description = optional(string, "Terraform managed.") enable_logging = optional(bool, false) healthy_threshold = optional(number) project_id = 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) })) }))">map(object({…}))</code> | | <code title="{ default = { http = { port_specification = "USE_SERVING_PORT" } } }">{…}</code> |
|
||||
| [labels](variables.tf#L48) | Labels set on resources. | <code>map(string)</code> | | <code>{}</code> |
|
||||
| [neg_configs](variables.tf#L59) | Optional network endpoint groups to create. Can be referenced in backends via key or outputs. | <code title="map(object({ project_id = optional(string) cloudrun = optional(object({ region = string target_service = optional(object({ name = string tag = optional(string) })) target_urlmask = optional(string) })) gce = optional(object({ zone = string network = optional(string) subnetwork = optional(string) endpoints = optional(list(object({ instance = string ip_address = string port = number }))) })) hybrid = optional(object({ zone = string network = optional(string) endpoints = optional(list(object({ ip_address = string port = number }))) })) }))">map(object({…}))</code> | | <code>{}</code> |
|
||||
| [neg_configs](variables.tf#L59) | Optional network endpoint groups to create. Can be referenced in backends via key or outputs. | <code title="map(object({ project_id = optional(string) cloudrun = optional(object({ region = string target_service = optional(object({ name = string tag = optional(string) })) target_urlmask = optional(string) })) gce = optional(object({ zone = string network = optional(string) subnetwork = optional(string) endpoints = optional(map(object({ instance = string ip_address = string port = number }))) })) hybrid = optional(object({ zone = string network = optional(string) endpoints = optional(map(object({ ip_address = string port = number }))) })) }))">map(object({…}))</code> | | <code>{}</code> |
|
||||
| [network_tier_premium](variables.tf#L119) | Use premium network tier. Defaults to true. | <code>bool</code> | | <code>true</code> |
|
||||
| [ports](variables.tf#L126) | Optional ports for HTTP load balancer, valid ports are 80 and 8080. | <code>list(string)</code> | | <code>null</code> |
|
||||
| [protocol](variables.tf#L137) | Protocol supported by this load balancer. | <code>string</code> | | <code>"HTTP"</code> |
|
||||
|
|
|
@ -15,9 +15,10 @@
|
|||
*/
|
||||
|
||||
locals {
|
||||
# we need keys in the endpoint type to address issue #1055
|
||||
_neg_endpoints = flatten([
|
||||
for k, v in local.neg_zonal : [
|
||||
for vv in v.endpoints : merge(vv, { neg = k, zone = v.zone })
|
||||
for kk, vv in v.endpoints : merge(vv, { neg = k, key = "${k}-${kk}", zone = v.zone })
|
||||
]
|
||||
])
|
||||
fwd_rule_ports = (
|
||||
|
@ -29,8 +30,7 @@ locals {
|
|||
: google_compute_region_target_http_proxy.default.0.id
|
||||
)
|
||||
neg_endpoints = {
|
||||
for v in local._neg_endpoints :
|
||||
"${v.neg}-${v.ip_address}-${coalesce(v.port, "none")}" => v
|
||||
for v in local._neg_endpoints : (v.key) => v
|
||||
}
|
||||
neg_regional = {
|
||||
for k, v in var.neg_configs :
|
||||
|
|
|
@ -73,7 +73,7 @@ variable "neg_configs" {
|
|||
# default_port = optional(number)
|
||||
network = optional(string)
|
||||
subnetwork = optional(string)
|
||||
endpoints = optional(list(object({
|
||||
endpoints = optional(map(object({
|
||||
instance = string
|
||||
ip_address = string
|
||||
port = number
|
||||
|
@ -85,7 +85,7 @@ variable "neg_configs" {
|
|||
network = optional(string)
|
||||
# re-enable once provider properly support this
|
||||
# default_port = optional(number)
|
||||
endpoints = optional(list(object({
|
||||
endpoints = optional(map(object({
|
||||
ip_address = string
|
||||
port = number
|
||||
})))
|
||||
|
|
|
@ -9,11 +9,13 @@ neg_configs = {
|
|||
custom = {
|
||||
gce = {
|
||||
zone = "europe-west1-b"
|
||||
endpoints = [{
|
||||
ip_address = "10.0.0.10"
|
||||
instance = "test-1"
|
||||
port = 80
|
||||
}]
|
||||
endpoints = {
|
||||
e-0 = {
|
||||
ip_address = "10.0.0.10"
|
||||
instance = "test-1"
|
||||
port = 80
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue