terraform-google-modules / terraform-google-cloud-nat

Creates and configures Cloud NAT
https://registry.terraform.io/modules/terraform-google-modules/cloud-nat/google
Apache License 2.0
81 stars 68 forks source link

Support for Dynamic Port Allocation #89

Closed alexander-verharen-qc closed 1 year ago

alexander-verharen-qc commented 1 year ago

TL;DR

Google and Terraform support dynamic port allocation, while this module does not yet support it.

The following new variables are needed:

max_ports_per_vm - (Optional) Maximum number of ports allocated to a VM from this NAT. This field can only be set when enableDynamicPortAllocation is enabled.

enable_dynamic_port_allocation - (Optional) Enable Dynamic Port Allocation. If minPortsPerVm is set, minPortsPerVm must be set to a power of two greater than or equal to 32. If minPortsPerVm is not set, a minimum of 32 ports will be allocated to a VM from this NAT config. If maxPortsPerVm is set, maxPortsPerVm must be set to a power of two greater than minPortsPerVm. If maxPortsPerVm is not set, a maximum of 65536 ports will be allocated to a VM from this NAT config. Mutually exclusive with enableEndpointIndependentMapping.

Terraform Resources

https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/compute_router_nat#enable_dynamic_port_allocation

Detailed design

enableDynamicPortAllocation can only be set to true if enableEndpointIndependentMapping is false.

Additional information

Google provider version 4.5 or greater

alexander-verharen-qc commented 1 year ago

sorry - duplicate issue

alexander-verharen-qc commented 1 year ago

Closing

github-actions[bot] commented 1 year ago

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 7 days