Skip to content

Commit

Permalink
Bugfix: honor upstream default for enableDynamicPortAllocation
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
dark committed Jun 14, 2022
1 parent ed2a76e commit 66cdb33
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 0 additions & 1 deletion mmv1/products/compute/api.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13479,7 +13479,6 @@ objects:
If minPortsPerVm is not set, a minimum of 32 ports will be allocated to a VM from this NAT config.

Mutually exclusive with enableEndpointIndependentMapping.
default_value: false
- !ruby/object:Api::Type::Integer
name: udpIdleTimeoutSec
description: |
Expand Down
2 changes: 2 additions & 0 deletions mmv1/products/compute/terraform.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2510,6 +2510,8 @@ overrides: !ruby/object:Overrides::ResourceOverrides
custom_flatten: 'templates/terraform/custom_flatten/default_if_empty.erb'
tcpTransitoryIdleTimeoutSec: !ruby/object:Overrides::Terraform::PropertyOverride
custom_flatten: 'templates/terraform/custom_flatten/default_if_empty.erb'
enableDynamicPortAllocation: !ruby/object:Overrides::Terraform::PropertyOverride
default_from_api: true
custom_code: !ruby/object:Provider::Terraform::CustomCode
constants: 'templates/terraform/constants/router_nat.go.erb'
resource_definition: 'templates/terraform/resource_definition/router_nat.go.erb'
Expand Down

0 comments on commit 66cdb33

Please sign in to comment.