fix(28): move Cloud Run max_instance_count into template.scaling (provider 6.50.0)#95
Merged
Merged
Conversation
…provider 6.50.0
The pinned hashicorp/google 6.50.0 schema does not accept max_instance_count
in the TOP-LEVEL `scaling` block of google_cloud_run_v2_service (that block
only supports min_instance_count / manual_instance_count / scaling_mode);
autoscaling max belongs in `template { scaling { ... } }`. `tofu validate`
failed with "An argument named max_instance_count is not expected here" at
all three services, blocking Phase 28 `tofu apply`.
Move min+max_instance_count into each service's template.scaling block,
keeping the same values (earnings_serving min=1/max=1, weather_serving
min=0/max=var, stt min=0/max=var). earnings_serving had the same bug, not
just weather_serving and stt. Placement-only change; no value changes.
`tofu -chdir=infra validate` now reports 0 cloud_run.tf errors.
Pre-existing on main (PR #92), independent of the deploy-runtime-layer branch.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
Parity ticket gate: PASSED See |
…uler cool-down Codex P2: moving min_instance_count into template.scaling decoupled it from scheduler.tf, which PATCHes the service-level scaling.minInstanceCount to flip the live-window warm/cool 0<->1. A revision-level min would pin the SSE instance warm 24/7. Keep min at service level; only max moves to template.scaling (max is invalid on the service-level block).
…invalid max)
Codex P1: the warm/cool PATCH bodies sent
{"scaling":{"minInstanceCount":N,"maxInstanceCount":1}} to the service-level
scaling field. maxInstanceCount is not a valid service-level ServiceScaling
field (it is revision-level, template.scaling in cloud_run.tf) and is outside
the updateMask=scaling.minInstanceCount, so it risks a 400 that stalls the SSE
warm/cool automation. Send only minInstanceCount.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
tofu -chdir=infra validate(OpenTofu, pinned hashicorp/google 6.50.0) fails with:blocking
tofu applyfor the entire Phase 28 hosted platform. Under 6.50.0,google_cloud_run_v2_service's top-levelscalingblock only acceptsmin_instance_count/manual_instance_count/scaling_mode— autoscaling max belongs intemplate { scaling { max_instance_count = ... } }(verified directly against the 6.50.0 provider schema).Pre-existing on
main(merged in #92), independent of the deploy-runtime-layer branch.Fix
Move
min_instance_count+max_instance_countinto each service'stemplate.scalingblock. Placement-only — no scaling values changed. Affects all threegoogle_cloud_run_v2_serviceresources:earnings_servingweather_servingvar.serving_rest_max_instancessttvar.stt_max_concurrencyKeeping min+max together as revision-level autoscaling bounds is the canonical pattern and stays consistent with the scheduler's
--min-instances0↔1 flip (which patches the revision template).Verification
tofu -chdir=infra validate→ 0cloud_run.tferrors (was 3).tofu fmt -check cloud_run.tf→ clean.Out of scope (flagging, not fixed here)
tofu validatestill reports one unrelated, pre-existing error:batch.tf:72google_batch_jobis not in the google-beta 6.50.0 schema (resource setsprovider = google-beta). Different resource, different root cause — worth a separate follow-up as it also blocks the weather-backfill Batch job'sapply.🤖 Generated with Claude Code