fix(infra): configure Classic ALB scheme and upgrade Google provider to v8 - #2810
Merged
Conversation
…to v8 Explicitly set load_balancing_scheme = "EXTERNAL" on backend services and global forwarding rules to unblock Cloud Build deployments under Google provider 8.0.0. ## Context & Root Cause PR #2804 merged Google provider 8.0.0 into infra/.terraform.lock.hcl. In provider 8.0.0, the default load_balancing_scheme changed from EXTERNAL to EXTERNAL_MANAGED. Because existing frontend and backend load balancers did not specify load_balancing_scheme, Cloud Build deployment failed with GCP API error 400 (Cannot change load balancing scheme until migration state is TEST_ALL_TRAFFIC). Downgrading to provider 7.x is rejected by Terraform because provider 8.0.0 already migrated state attributes (such as google_secret_manager_secret_version.otel_config_version from Integer to String). Reverting remote state in GCS risks state drift. ## Solution Following HashiCorp's Provider 8.0.0 Upgrade Guide, we explicitly declare load_balancing_scheme = "EXTERNAL" to preserve Classic ALB behavior with zero unwanted mutations: - infra/frontend/service.tf: Set load_balancing_scheme = "EXTERNAL" on lb_backend and both forwarding rules. - infra/backend/service.tf: Set load_balancing_scheme = "EXTERNAL" on lb_backend and both forwarding rules. - infra/storage/repo_storage_bucket.tf: Quote retention_period string to align with provider v8 schema. - infra/providers.tf: Update constraint to '>= 8.0.0' with documentation referencing #2808 for future migration to EXTERNAL_MANAGED. Fixes #2807 Refs #2808
jcscottiii
enabled auto-merge
September 1, 2026 19:09
jrobbins
approved these changes
Sep 2, 2026
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.
Summary
Explicitly set
load_balancing_scheme = "EXTERNAL"on backend services and global forwarding rules to unblock Cloud Build deployments under Google provider 8.0.0.Supersedes #2809.
Context & Root Cause
PR #2804 merged Google provider 8.0.0 into
infra/.terraform.lock.hcl. In provider 8.0.0, the defaultload_balancing_schemechanged fromEXTERNALtoEXTERNAL_MANAGED. Because existing frontend and backend load balancers did not specifyload_balancing_scheme, Cloud Build deployment failed with GCP API error 400 (Cannot change load balancing scheme until migration state is TEST_ALL_TRAFFIC).Corrected Assumptions & Learnings from #2809
In #2809, an initial attempt was made to downgrade the provider back to 7.x (
7.46.0). However, when PR #2804 merged, Cloud Build had already executedterraform applyon staging with provider 8.0.0, successfully upgrading several state schemas (such asgoogle_secret_manager_secret_version.otel_config_version, wheresecret_data_wo_versionwas migrated from an Integer to a String).When provider 7.x reads the upgraded state, it fails with:
Downgrading would require manually restoring older soft-deleted state files from GCS, which risks state drift for all resources deployed since then.
How It Was Implemented
Following HashiCorp's Provider 8.0.0 Upgrade Guide, we embrace provider 8.0.0 and explicitly declare
load_balancing_scheme = "EXTERNAL"to preserve Classic ALB behavior with zero unwanted mutations:infra/frontend/service.tf: Setload_balancing_scheme = "EXTERNAL"onlb_backendand both forwarding rules (httpsandmain).infra/backend/service.tf: Setload_balancing_scheme = "EXTERNAL"onlb_backendand both forwarding rules (httpsandmain).infra/storage/repo_storage_bucket.tf: Quoteretention_period = "2630000"to align with provider v8 string schema.infra/providers.tf: Update constraint to>= 8.0.0with documentation referencing feat(infra): Preliminary Report: Migrate Classic Application Load Balancers to Global External ALBs #2808 for the future staged migration toEXTERNAL_MANAGED.Verification
make tf-lintpassed cleanly inside the DevContainer for both staging and production.terraform planexecuted against the live remote staging state in GCS (staging.tfstate) passed with exit code 0 and zero decode or scheme errors.Fixes #2807
Refs #2808