Repository navigation
Description
Problem or Motivation
tf/gcp/versions.tf pins the provider hashicorp/google at ~> 5.0. The newest is 8.11 (registry.opentofu.org), three majors later. Renovate (#4893) will offer them.
- v6: the attribution label
goog-terraform-provisionedgoes on new resources; label fields change ongoogle_container_cluster; empty-list forms are removed. - v7: import validation;
enable_flow_logsof a subnetwork is removed. - v8:
logging_configandmonitoring_configenable_componentsofgoogle_container_clusterbecome sets; node poolname_prefix.
tf/gcp sets none of the removed fields, but the three majors change the plan output and the defaults. No CI job runs tofu validate on tf/, and tofu is not installed in the devcontainer.
Research of 2026-11-12 (research-ci, record tofu:hashicorp/google).
Proposed Solution & Architectural Design
- Set
~> 8.11intf/gcp/versions.tf; edittf/gcp/main.tfwhere the guides require it. - Decide on the attribution label default (keep or turn off with
add_terraform_attribution_label). - Run
tofu init -backend=false && tofu validateintf/gcp, andtofu planagainst a test project if one exists. Record the output in the pull request.
Done when tofu validate passes on tf/gcp with google 8.11.
Target Subsystem
OpenTofu / Infrastructure as Code
Existing Tool Considered
OpenTofu (tofu validate, tofu plan) and the google provider upgrade guides. No new code.
Source: #4893
Alternatives check of 2026-11-22: none.
Tool: none found.
Reason: Searches found only tfupdate, which rewrites the version constraint that Renovate already offers, and the provider upgrade guides; nothing edits main.tf, decides the attribution label, or gates CI on tofu validate.
Lacks:
- Rewrites only the version constraint line, which Renovate already bumps
- Makes no provider block or main.tf edit
- Runs no tofu init, validate or plan
- Adds no required CI step and no validation gate
Proposed design
Problem statement
tf/gcp/versions.tf pins the provider hashicorp/google at ~> 5.0. The newest is 8.11, three majors later. The 6.x, 7.x and 8.x majors change the defaults and remove fields, and no check runs tofu validate on tf/. The change sets ~> 8.11, records the attribution-label choice, and makes tofu validate a CI gate.
Acceptance criteria
Requirement: Google provider constraint
tf/gcp/versions.tf SHALL pin the provider hashicorp/google at ~> 8.11.
Scenario: The google constraint is 8.11
- WHEN a test reads the
googleentry ofrequired_providersintf/gcp/versions.tf - THEN the entry holds
version = "~> 8.11".
Requirement: Attribution label is off
The google provider block in tf/gcp/main.tf SHALL set add_terraform_attribution_label = false.
Scenario: The provider block disables the attribution label
- WHEN a test reads the
googleprovider block intf/gcp/main.tf - THEN the block holds
add_terraform_attribution_label = false.
Requirement: No removed subnetwork field
tf/gcp/main.tf MUST NOT set enable_flow_logs on google_compute_subnetwork.
Scenario: The subnetwork sets no removed field
- WHEN a test searches
tf/gcp/main.tfforenable_flow_logs - THEN the search returns no match.
Requirement: CI runs the validation
The required Static Analysis check SHALL run tofu init -backend=false and tofu validate in tf/gcp.
Scenario: Static Analysis holds the tofu step
- WHEN a test reads the workflow that defines the
Static Analysisjob - THEN the job holds a step that runs
tofu init -backend=falseandtofu validateintf/gcp.
Requirement: The bump validates at 8.11
tf/gcp MUST pass tofu validate with hashicorp/google 8.11.
Scenario: Validate exits zero at 8.11
- WHEN CI runs
tofu validateintf/gcpat the head of the pull request - THEN the command exits 0 and reports no error.
Existing Tool Considered
None: no open, maintained tool covers the need (alternatives check of 2026-11-15). The closest is minamijoyo/tfupdate (MIT, active 2026-10-26). It rewrites only the ~> 5.0 line in tf/gcp/versions.tf, and Renovate already offers that line. It makes no tf/gcp/main.tf edit, decides no attribution label, and runs no tofu init or tofu validate. The provider upgrade guides are documentation of the dependency, not a tool. The change builds no new code, so it has no build cost beyond the review of one constraint line, one provider argument and one CI step.
Key questions
- Which removed or changed fields of the google 6.x, 7.x and 8.x majors does the
tf/gcpconfiguration set?: None.google_compute_subnetwork.subnetsets noenable_flow_logs.google_container_cluster.gkesets nologging_configormonitoring_config. No resource assigns an empty list.google_container_node_pool.primary_nodessetsname, and it sets noname_prefix. [sources: tf/gcp/main.tf] - Does the google provider add the
goog-terraform-provisionedattribution label to new resources?: No. Setadd_terraform_attribution_label = falsein thegoogleprovider block. The bump then adds no label to a resource, and resources created before and after the bump stay alike. (best practice) [sources: tf/gcp/main.tf]- Rejected: Keep the provider default and add the label. The provider adds the label only to resources created after the bump, so old and new resources would differ. No project decision asks for the label.
- Chosen: Set
add_terraform_attribution_label = false. The bump keeps the resource labels as they are. No project decision asks for a new label.
- How does the change run
tofu validatewhen no environment of the repository hastofu?: Add the run to the requiredStatic Analysischeck. The check installs OpenTofu and runstofu init -backend=falseandtofu validateintf/gcp. If google 8.11 needs a floor above>= 1.6.0, the same pull request raisesrequired_version. (best practice) [sources: docs/adr/0004-ci-is-the-authoritative-gate.md, tf/gcp/versions.tf]- Rejected: Run
tofu validateby hand and paste the output in the pull request. No environment of the job hastofu, and a pasted output is no repeatable gate. - Chosen: Add the run to the required
Static Analysischeck. CI is the authoritative gate (ADR 0004). The check blocks a merge and repeats on each change. - Rejected: Add a new CI job for
tf/and make it a required check. A new required check needs a change of themainruleset, and only a person makes that change. The requiredStatic Analysischeck gates now. - Rejected: Ship the bump with no validation. A major version bump would merge unverified.
- Rejected: Run
Fit
Fits in one pull request.
Suspected block
None.
Dependencies
None.
Activity
dan-petty commentedon Nov 12, 2026
Both target the Terraform/OpenTofu subsystem, but 310 researches in-process HCL parsing while the candidate bumps the google provider version.devops-cli-service commentedon Nov 12, 2026
Both items upgrade a pinned Terraform provider across major versions and check the result with OpenTofu, but they change different providers, files and fields.build(deps): take every safe version update before Renovate (#5102)
devops-cli-service commentedon Nov 15, 2026
Alternatives check: none
Reason: Searches for the google provider 8.x upgrade and for a tool that bumps Terraform provider constraints returned only generic Terraform/OpenTofu container images and no tool that migrates a provider major version. The closest open tool, tfupdate, only rewrites a version constraint string (a line Renovate already offers, per the issue), and leaves the main.tf edits the upgrade guides require, the attribution-label decision and the
tofu validate/planrun to the project's own configuration, so nothing covers the need.Tool: none found
Lacks:
enable_flow_logs,enable_componentssets, node poolname_prefix)add_terraform_attribution_labeldefault or rewritestf/gcp/main.tfaccordingly~> 5.0constraint intf/gcp/versions.tf; it runs notofu init -backend=false,tofu validateortofu planand adds no CI checkTools considered:
Searches run:
Sources:
Checked on 2026-11-15. A person decides what this means for the item. The check changes no label and closes no issue.
devops-cli-service commentedon Nov 16, 2026
Status set to Ready at 3355a77 (see proposed design in issue body).
Moved to new items: dan-petty/infra#184.
dan-petty commentedon Nov 25, 2026
Closed as not planned. The hand-written
tf/gcpconfiguration that this item updates was removed fromdan-petty/devops-cliby commit7344d29e8(#6767,Closes dan-petty/devops-cli#6679) per ADR 0032 (#6674). The GCP OpenTofu example and module now live indan-petty/infra(tf/examples/gcp,tf/modules/gcp-gke), wheretf/examples/gcp/versions.tfalready pinshashicorp/googleat8.12.0(required_version >= 1.17.2) anddan-petty/infra'sOpenTofuCI job runstofu init -backend=false -input=falseandtofu validate.