-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
google_cloud_run_v2_service should validate that scaling.min_instance_count is less than scaling.max_instance_count #18969
google_cloud_run_v2_service should validate that scaling.min_instance_count is less than scaling.max_instance_count #18969
Comments
required_with
each other
From triage: Updated the title to reflect that not only should the docs be updated, we should also mark the fields as |
https://github.com/GoogleCloudPlatform/magic-modules/blob/main/mmv1/templates/terraform/examples/cloudrunv2_service_sql.tf.erb#L8 is a passing example of |
The above error might be due to setting |
required_with
each other
Indeed - the error just says that max_instance_count needs to be greater than min_instance_count. Thanks for the catch! |
@melinath, Not just Cloud Run, Other Services where there is Range Arguments (min & max) would need this kind of validation. Spanner - https://cloud.google.com/spanner/docs/reference/rest/v1/projects.instances#autoscalinglimits Since ValidateFunc is supported Only for Primitive Types. is there any way we can add Validation for Nested Objects. |
you can do cross-field validation using a CustomizeDiff function. For MMv1 resources, this can be set up using the |
Cloud Run has a dynamic default max instances, based on the user's available quota in the region and specified instance size which makes doing accurate checks in the client rather difficult. Is there a downside to leaving this as it is and letting the server validate it? |
Community Note
Description
With regards to this page
https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/cloud_run_v2_service
For the scaling block, update the documentation to state that
max_instance_count
is required to be present whenmin_instance_count
is specified and vice versa. Failure to do so would result in the following error (here I did not specify max_instance_count only min_instance_count):New or Affected Resource(s)
Potential Terraform Configuration
References
No response
b/357621141
The text was updated successfully, but these errors were encountered: