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 #2471

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 requested a review from a team as a code owner June 28, 2024 19:51
@modular-magician modular-magician requested review from ScottSuarez and removed request for a team June 28, 2024 19:51
Copy link

🤖 I detect that the PR title and the commit message differ and there's only one commit. To use the PR title for the commit history, you can use Github's automerge feature with squashing, or use automerge label. Good luck human!

-- conventional-commit-lint bot
https://conventionalcommits.org/

@modular-magician modular-magician merged commit 9091b6b into GoogleCloudPlatform:main Jun 28, 2024
3 checks passed
@modular-magician modular-magician deleted the downstream-pr-86415d0d14a3c2a62bffdb7c6e8348f0fbf1c977 branch November 18, 2024 06:13
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