Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support Dynamic Port Allocation #64

Closed
kustodian opened this issue Dec 16, 2021 · 17 comments
Closed

Support Dynamic Port Allocation #64

kustodian opened this issue Dec 16, 2021 · 17 comments
Labels
enhancement New feature or request P3 medium priority issues triaged Scoped and ready for work

Comments

@kustodian
Copy link

kustodian commented Dec 16, 2021

TL;DR

Add support for Cloud Nat Dynamic Port Allocation. The feature is currently in Preview.

Terraform Resources

[google_compute_router_nat](https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/compute_router_nat)

Detailed design

I guess the resource should add support for the two additional parameters: `max_ports_per_vm` and `enable_dynamic_port_allocation`.

Example:

resource "google_compute_router_nat" "nat" {
  name                               = "my-router-nat"
  router                             = google_compute_router.router.name
  region                             = google_compute_router.router.region
  nat_ip_allocate_option             = "AUTO_ONLY"
  source_subnetwork_ip_ranges_to_nat = "ALL_SUBNETWORKS_ALL_IP_RANGES"

  min_ports_per_vm: 32
  max_ports_per_vm: 64000
  enable_dynamic_port_allocation: true
}


### Additional information

_No response_
@kustodian kustodian added the enhancement New feature or request label Dec 16, 2021
@morgante morgante added P3 medium priority issues triaged Scoped and ready for work labels Dec 16, 2021
@kustodian
Copy link
Author

This is now GA so it would be awesome if it is supported.

@qfaure
Copy link

qfaure commented Mar 4, 2022

any update on the feature ?

@hanikesn
Copy link

@qfaure
Copy link

qfaure commented May 24, 2022

@hanikesn it's now released on the provider google. https://github.com/hashicorp/terraform-provider-google/releases/tag/v4.22.0

@KG48037
Copy link

KG48037 commented May 24, 2022

max_ports_per_vm was not included in their latest release

@billyfoss
Copy link

Please note that by the provider defaulting to false, it will revert DPA that has been enabled by other means. Previous to 4.22 it was possible to enable DPA and this module would ignore the setting. Now it will revert it.

dark added a commit to dark/magic-modules that referenced this issue Jun 14, 2022
Having a hardcoded default_value of `false` for the
`enableDynamicPortAllocation` property is troublesome, and the
upstream default should be used. This was added as part of GoogleCloudPlatform#6022.

By hardcoding the default here, any client will explicitly deprogram
the dynamic port allocation setting if it is not part of the client
configuration. This is causing problems for those clients that have
enabled the dynamic port allocation out of band, since the current
support is incomplete (not all parameters can be set via Terraform:
terraform-google-modules/terraform-google-cloud-nat#64 (comment)). While
full support is being added, removing hardcoded defaults allow
out-of-band configurations to continue working.
@pschmidbauer
Copy link

Thanks for merging this. When will it be released?

dark added a commit to dark/magic-modules that referenced this issue Jun 21, 2022
…amicPortAllocation

Support for the Dynamic Port Allocation feature (tracked in
terraform-google-modules/terraform-google-cloud-nat#64 and
hashicorp/terraform-provider-google#11052) was initially implemented
in GoogleCloudPlatform#6022, but it lacked support for the maxPortsPerVm field. This
field is crucial to allow the full configuration to work.
melinath pushed a commit to GoogleCloudPlatform/magic-modules that referenced this issue Jun 22, 2022
…amicPortAllocation (#6155)

Support for the Dynamic Port Allocation feature (tracked in
terraform-google-modules/terraform-google-cloud-nat#64 and
hashicorp/terraform-provider-google#11052) was initially implemented
in #6022, but it lacked support for the maxPortsPerVm field. This
field is crucial to allow the full configuration to work.
modular-magician added a commit to modular-magician/terraform-provider-google-beta that referenced this issue Jun 22, 2022
…amicPortAllocation (hashicorp#6155)

Support for the Dynamic Port Allocation feature (tracked in
terraform-google-modules/terraform-google-cloud-nat#64 and
hashicorp/terraform-provider-google#11052) was initially implemented
in hashicorp#6022, but it lacked support for the maxPortsPerVm field. This
field is crucial to allow the full configuration to work.

Signed-off-by: Modular Magician <[email protected]>
modular-magician added a commit to modular-magician/terraform-provider-google that referenced this issue Jun 22, 2022
…amicPortAllocation (hashicorp#6155)

Support for the Dynamic Port Allocation feature (tracked in
terraform-google-modules/terraform-google-cloud-nat#64 and
hashicorp#11052) was initially implemented
in hashicorp#6022, but it lacked support for the maxPortsPerVm field. This
field is crucial to allow the full configuration to work.

Signed-off-by: Modular Magician <[email protected]>
modular-magician added a commit to hashicorp/terraform-provider-google-beta that referenced this issue Jun 22, 2022
…amicPortAllocation (#6155) (#4400)

Support for the Dynamic Port Allocation feature (tracked in
terraform-google-modules/terraform-google-cloud-nat#64 and
hashicorp/terraform-provider-google#11052) was initially implemented
in #6022, but it lacked support for the maxPortsPerVm field. This
field is crucial to allow the full configuration to work.

Signed-off-by: Modular Magician <[email protected]>
modular-magician added a commit to hashicorp/terraform-provider-google that referenced this issue Jun 22, 2022
…amicPortAllocation (#6155) (#11933)

Support for the Dynamic Port Allocation feature (tracked in
terraform-google-modules/terraform-google-cloud-nat#64 and
#11052) was initially implemented
in #6022, but it lacked support for the maxPortsPerVm field. This
field is crucial to allow the full configuration to work.

Signed-off-by: Modular Magician <[email protected]>
modular-magician added a commit to modular-magician/terraform-validator that referenced this issue Jun 22, 2022
…amicPortAllocation (#6155)

Support for the Dynamic Port Allocation feature (tracked in
terraform-google-modules/terraform-google-cloud-nat#64 and
hashicorp/terraform-provider-google#11052) was initially implemented
in #6022, but it lacked support for the maxPortsPerVm field. This
field is crucial to allow the full configuration to work.

Signed-off-by: Modular Magician <[email protected]>
modular-magician added a commit to GoogleCloudPlatform/terraform-validator that referenced this issue Jun 22, 2022
…amicPortAllocation (#6155) (#777)

Support for the Dynamic Port Allocation feature (tracked in
terraform-google-modules/terraform-google-cloud-nat#64 and
hashicorp/terraform-provider-google#11052) was initially implemented
in #6022, but it lacked support for the maxPortsPerVm field. This
field is crucial to allow the full configuration to work.

Signed-off-by: Modular Magician <[email protected]>
@ep4sh
Copy link

ep4sh commented Jun 30, 2022

Guys, any updates on this feature?

@hanikesn
Copy link

@ep4sh This now fully working in the latest release

@pschmidbauer
Copy link

@hanikesn I cannot see anything like "enable_dynamic_port_allocation = var.enable_dynamic_port_allocation" here: https://github.com/terraform-google-modules/terraform-google-cloud-nat/blob/master/main.tf

When will it be released? Or am I looking somewhere wrong?

@nikhilmakhijani
Copy link
Contributor

nikhilmakhijani commented Aug 29, 2022

#73 PR-Added dynamic port feature

@kustodian
Copy link
Author

Awesome!

@gnubibi33
Copy link

Any update ? PR looks to be stuck.

@nikhilmakhijani
Copy link
Contributor

@bharathkkb can this be merged?

@leeleelou
Copy link

It looks like the Dynamic Port Mapping was released as a part of v4.0.0. However, this still didn't include the max_ports_per_vm key. This is causing Terraform to always see a change in Cloud NAT when dynamic port mapping is enabled.

@ankurgupta-fk
Copy link

@leeleelou Facing the same issue. Logged #123

@nikhilmakhijani
Copy link
Contributor

nikhilmakhijani commented Jun 23, 2023

@leeleelou Facing the same issue. Logged #123

Raised PR. Let me know your thoughts

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request P3 medium priority issues triaged Scoped and ready for work
Projects
None yet
Development

No branches or pull requests