Added support for PSC negs in net-ilb-l7 module
This commit is contained in:
parent
ae73274bfb
commit
ebeace21dd
File diff suppressed because one or more lines are too long
|
@ -26,6 +26,9 @@ locals {
|
|||
},
|
||||
{
|
||||
for k, v in google_compute_region_network_endpoint_group.default : k => v.id
|
||||
},
|
||||
{
|
||||
for k, v in google_compute_region_network_endpoint_group.psc : k => v.id
|
||||
}
|
||||
)
|
||||
hc_ids = {
|
||||
|
|
|
@ -49,6 +49,10 @@ locals {
|
|||
zone = v.gce != null ? v.gce.zone : v.hybrid.zone
|
||||
} if v.gce != null || v.hybrid != null
|
||||
}
|
||||
neg_regional_psc = {
|
||||
for k, v in var.neg_configs :
|
||||
k => v if v.psc != null
|
||||
}
|
||||
proxy_ssl_certificates = concat(
|
||||
coalesce(var.ssl_certificates.certificate_ids, []),
|
||||
[for k, v in google_compute_region_ssl_certificate.default : v.id]
|
||||
|
@ -187,3 +191,15 @@ resource "google_compute_region_network_endpoint_group" "default" {
|
|||
url_mask = each.value.target_urlmask
|
||||
}
|
||||
}
|
||||
|
||||
resource "google_compute_region_network_endpoint_group" "psc" {
|
||||
for_each = local.neg_regional_psc
|
||||
project = var.project_id
|
||||
region = each.value.psc.region
|
||||
name = "${var.name}-${each.key}"
|
||||
//description = coalesce(each.value.description, var.description)
|
||||
network_endpoint_type = "PRIVATE_SERVICE_CONNECT"
|
||||
psc_target_service = each.value.psc.target_service
|
||||
network = each.value.psc.network
|
||||
subnetwork = each.value.psc.subnetwork
|
||||
}
|
||||
|
|
|
@ -90,7 +90,12 @@ variable "neg_configs" {
|
|||
port = number
|
||||
})))
|
||||
}))
|
||||
# psc = optional(object({}))
|
||||
psc = optional(object({
|
||||
region = string
|
||||
target_service = string
|
||||
network = optional(string)
|
||||
subnetwork = optional(string)
|
||||
}))
|
||||
}))
|
||||
default = {}
|
||||
nullable = false
|
||||
|
@ -99,7 +104,8 @@ variable "neg_configs" {
|
|||
for k, v in var.neg_configs : (
|
||||
(try(v.cloudrun, null) == null ? 0 : 1) +
|
||||
(try(v.gce, null) == null ? 0 : 1) +
|
||||
(try(v.hybrid, null) == null ? 0 : 1) == 1
|
||||
(try(v.hybrid, null) == null ? 0 : 1) +
|
||||
(try(v.psc, null) == null ? 0 : 1) == 1
|
||||
)
|
||||
])
|
||||
error_message = "Only one type of neg can be configured at a time."
|
||||
|
|
Loading…
Reference in New Issue