From 019cca735d8e1d4a7e71abf981fce7daa288f734 Mon Sep 17 00:00:00 2001 From: Luca Prete Date: Tue, 24 Oct 2023 15:37:33 +0200 Subject: [PATCH] net-lb-ext: add option to set IPv6 subnetwork for IPv6 external fw rules --- modules/net-lb-ext/README.md | 18 +++++++++--------- modules/net-lb-ext/main.tf | 1 + modules/net-lb-ext/variables.tf | 1 + 3 files changed, 11 insertions(+), 9 deletions(-) diff --git a/modules/net-lb-ext/README.md b/modules/net-lb-ext/README.md index 18d2859d..020c1104 100644 --- a/modules/net-lb-ext/README.md +++ b/modules/net-lb-ext/README.md @@ -231,18 +231,18 @@ module "nlb" { | name | description | type | required | default | |---|---|:---:|:---:|:---:| -| [name](variables.tf#L197) | Name used for all resources. | string | ✓ | | -| [project_id](variables.tf#L202) | Project id where resources will be created. | string | ✓ | | -| [region](variables.tf#L218) | GCP region. | string | ✓ | | +| [name](variables.tf#L198) | Name used for all resources. | string | ✓ | | +| [project_id](variables.tf#L203) | Project id where resources will be created. | string | ✓ | | +| [region](variables.tf#L219) | GCP region. | string | ✓ | | | [backend_service_config](variables.tf#L17) | Backend service level configuration. | object({…}) | | {} | | [backends](variables.tf#L66) | Load balancer backends. | list(object({…})) | | [] | | [description](variables.tf#L77) | Optional description used for resources. | string | | "Terraform managed." | -| [forwarding_rules_config](variables.tf#L83) | The optional forwarding rules configuration. | map(object({…})) | | {…} | -| [group_configs](variables.tf#L97) | Optional unmanaged groups to create. Can be referenced in backends via outputs. | map(object({…})) | | {} | -| [health_check](variables.tf#L108) | Name of existing health check to use, disables auto-created health check. | string | | null | -| [health_check_config](variables.tf#L114) | Optional auto-created health check configuration, use the output self-link to set it in the auto healing policy. Refer to examples for usage. | object({…}) | | {…} | -| [labels](variables.tf#L191) | Labels set on resources. | map(string) | | {} | -| [protocol](variables.tf#L207) | IP protocol used, defaults to TCP. UDP or L3_DEFAULT can also be used. | string | | "TCP" | +| [forwarding_rules_config](variables.tf#L83) | The optional forwarding rules configuration. | map(object({…})) | | {…} | +| [group_configs](variables.tf#L98) | Optional unmanaged groups to create. Can be referenced in backends via outputs. | map(object({…})) | | {} | +| [health_check](variables.tf#L109) | Name of existing health check to use, disables auto-created health check. | string | | null | +| [health_check_config](variables.tf#L115) | Optional auto-created health check configuration, use the output self-link to set it in the auto healing policy. Refer to examples for usage. | object({…}) | | {…} | +| [labels](variables.tf#L192) | Labels set on resources. | map(string) | | {} | +| [protocol](variables.tf#L208) | IP protocol used, defaults to TCP. UDP or L3_DEFAULT can also be used. | string | | "TCP" | ## Outputs diff --git a/modules/net-lb-ext/main.tf b/modules/net-lb-ext/main.tf index fafa3649..534b112a 100644 --- a/modules/net-lb-ext/main.tf +++ b/modules/net-lb-ext/main.tf @@ -43,6 +43,7 @@ resource "google_compute_forwarding_rule" "forwarding_rules" { ports = each.value.ports # "nnnnn" or "nnnnn,nnnnn,nnnnn" max 5 all_ports = each.value.ports == null ? true : null labels = var.labels + subnetwork = each.value.subnetwork # is_mirroring_collector = false } diff --git a/modules/net-lb-ext/variables.tf b/modules/net-lb-ext/variables.tf index c9e16ae2..4c24f732 100644 --- a/modules/net-lb-ext/variables.tf +++ b/modules/net-lb-ext/variables.tf @@ -88,6 +88,7 @@ variable "forwarding_rules_config" { ip_version = optional(string) ports = optional(list(string), null) protocol = optional(string, "TCP") + subnetwork = optional(string) # Required for IPv6 })) default = { "" = {}