From aab8c688071fc5e1a1792fca39e7912d6e3aadfc Mon Sep 17 00:00:00 2001 From: Giuseppe Arancio Date: Mon, 5 Aug 2024 11:59:49 +0200 Subject: [PATCH] refs platform/2733: add settings for cloud nat --- main.tf | 4 +++- variables.tf | 18 ++++++++++++++++++ 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/main.tf b/main.tf index 9ec7823..4a557c0 100644 --- a/main.tf +++ b/main.tf @@ -147,8 +147,10 @@ module "cloud_nat" { create_router = true # We force the endpoint independent mapping to false as described in this issue: # https://github.com/hashicorp/terraform-provider-google/issues/10609 - enable_endpoint_independent_mapping = false + enable_endpoint_independent_mapping = var.cloud_nat_endpoint_independent_mapping + enable_dynamic_port_allocation = var.cloud_nat_dynamic_port_allocation min_ports_per_vm = var.cloud_nat_min_ports_per_vm + max_ports_per_vm = var.cloud_nat_max_ports_per_vm log_config_enable = var.cloud_nat_log_config_enable log_config_filter = var.cloud_nat_log_config_filter } diff --git a/variables.tf b/variables.tf index 9bd7267..075470c 100644 --- a/variables.tf +++ b/variables.tf @@ -781,12 +781,30 @@ variable "gitlab_gitaly_max_unavailable" { default = 0 } +variable "cloud_nat_endpoint_independent_mapping" { + type = bool + description = "Specifies if endpoint independent mapping is enabled." + default = false +} + variable "cloud_nat_min_ports_per_vm" { type = string description = "Minimum number of ports allocated to a VM from this NAT config." default = "64" } +variable "cloud_nat_max_ports_per_vm" { + type = string + description = "Maximum number of ports allocated to a VM from this NAT. This field can only be set when cloud_nat_dynamic_port_allocation is enabled.This will be ignored if cloud_nat_dynamic_port_allocation is set to false." + default = null +} + +variable "cloud_nat_dynamic_port_allocation" { + type = bool + description = "Enable Dynamic Port Allocation. If cloud_nat_min_ports_per_vm is set, cloud_nat_min_ports_per_vm must be set to a power of two greater than or equal to 32." + default = false +} + variable "cloud_nat_log_config_enable" { type = bool description = "Indicates whether or not to export logs."