Skip to content

Commit

Permalink
Merge pull request #74 from sparkfabrik/cloud_nat_settings
Browse files Browse the repository at this point in the history
refs platform/2733: add settings for cloud nat
  • Loading branch information
Syphon83 authored Aug 5, 2024
2 parents d196b8d + aab8c68 commit fd6fd0b
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
4 changes: 3 additions & 1 deletion main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
18 changes: 18 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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."
Expand Down

0 comments on commit fd6fd0b

Please sign in to comment.