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

Autoscaler maxreplicas fix #7658

Conversation

modular-magician
Copy link
Collaborator

This PR removes unnecessary requirements reported in hashicorp/terraform-provider-google#18332.

This was an inconsistency, since in both terraform registry and Google Cloud documentation it's not specified that the value cannot be 0.

Google Cloud API gives you ability to create Autoscaler or Regional Autoscaler which have both minReplicas and maxReplicas set to 0. I've created one in Google Cloud Console and it worked just fine.

For the reported issue , I checked and request was missing max_num_replica field. For both zonal and regional autoscaler resources, I checked and min_num_replica field has send_empty_value set, while max_num_replica field doesn't. If we read the documentation of send_empty_value, this is the reason why max_num_replica was omitted entirely from the API request, when it was set to 0.

Fixes hashicorp/terraform-provider-google#18332

compute: fixed a bug preventing the creation of `google_compute_autoscaler` and `google_compute_region_autoscaler` resources if both `maxReplicas` and `minReplicas` were configured as zero.

Derived from GoogleCloudPlatform/magic-modules#11083

[upstream:86415d0d14a3c2a62bffdb7c6e8348f0fbf1c977]

Signed-off-by: Modular Magician <[email protected]>
@modular-magician modular-magician merged commit 04f3002 into hashicorp:main Jun 28, 2024
4 checks passed
@modular-magician modular-magician deleted the downstream-pr-86415d0d14a3c2a62bffdb7c6e8348f0fbf1c977 branch November 16, 2024 04:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

google_compute_autoscaler update error
1 participant