Skip to content

cloudrunv2: permadiff fix - set template.scaling.maxInstanceCount to default_value: true#18394

Open
BBBmau wants to merge 1 commit into
GoogleCloudPlatform:mainfrom
BBBmau:cloud-run-service-maxInstanceCount-default
Open

cloudrunv2: permadiff fix - set template.scaling.maxInstanceCount to default_value: true#18394
BBBmau wants to merge 1 commit into
GoogleCloudPlatform:mainfrom
BBBmau:cloud-run-service-maxInstanceCount-default

Conversation

@BBBmau

@BBBmau BBBmau commented Jul 24, 2026

Copy link
Copy Markdown
Collaborator

Part of hashicorp/terraform-provider-google#20399
reimplementing of #14971

Initially this wasn't merged due to some uncertainties surrounding the expected values that could be set by the API for maxInstanceCount. Though from looking through past PRs we get the following on how values are calculated for maxinstanceCount:

PR Comment:

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?

Given that the docs contains the mention that if not set it will default to what the server determines is the appropriate value, this PR makes sense to include since the current behavior does not match what the documentation is stating:

If absent, Cloud Run will calculate a default value based on the project's available container instances quota in the region and specified instance size.

Release Note Template for Downstream PRs (will be copied)

See Write release notes for guidance.

cloudrunv2: set `template.scaling.maxInstanceCount` to `default_api: true` in `google_cloud_run_v2_service` resource

@modular-magician

modular-magician commented Jul 24, 2026

Copy link
Copy Markdown
Collaborator

Hi there, I'm the Modular magician. I've detected the following information about your changes for commit 6aedba3:

Diff report

Your PR generated the following diffs in downstream repositories:

Repository Diff Link Changes
google provider View Diff 1 file changed, 1 insertion(+)
google-beta provider View Diff 1 file changed, 1 insertion(+)

Missing test report

Your PR includes resource fields which are not covered by any test.

Resource: google_cloud_run_v2_service (79 total tests)
Please add an acceptance test which includes these fields. The test should include the following:

resource "google_cloud_run_v2_service" "primary" {
  template {
    scaling {
      max_instance_count = # value needed
    }
  }
}

Test report

Analytics

Total Tests Passed Skipped Affected
92 83 9 0
Affected Service Packages
  • cloudrunv2

Learn how VCR tests work


Step 1: Replaying Mode

🟢 All tests passed in Replaying mode! No Recording was needed.

View the replaying VCR build log

@BBBmau, @melinath, @ian-mi VCR tests complete for 6aedba3!

@modular-magician
modular-magician requested a review from ian-mi July 24, 2026 21:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants