Repository navigation
Description
Problem or Motivation
tf/azure/versions.tf pins the provider hashicorp/azurerm at ~> 3.100. The newest is 5.13 (registry.opentofu.org). Renovate (#4893) will offer two majors. The pin alone fails:
- 4.0 upgrade guide: the provider block needs
subscription_id(orARM_SUBSCRIPTION_ID).tf/azure/main.tfhasprovider "azurerm" { features {} }. - 4.0:
default_node_pool.enable_auto_scalingis renamedauto_scaling_enabled.tf/azure/main.tfsetsenable_auto_scaling = true. - The 5.0 guide removes more fields of
azurerm_kubernetes_cluster,azurerm_subnetandazurerm_virtual_network.
No CI job runs tofu validate on tf/, and tofu is not installed in the devcontainer. The research read only the upgrade guides.
Research of 2026-11-12 (research-ci, record tofu:hashicorp/azurerm).
Proposed Solution & Architectural Design
- Set
~> 5.13and make the 4.0 and 5.0 guide edits intf/azure/main.tf. - Run
tofu init -backend=false && tofu validateintf/azure(andtofu planagainst a test subscription if one exists). Record the output in the pull request.
Done when tofu validate passes on tf/azure with azurerm 5.13.
Target Subsystem
OpenTofu / Infrastructure as Code
Existing Tool Considered
OpenTofu (tofu validate) and the azurerm upgrade guides. No new code.
Source: #4893
Alternatives check of 2026-11-15: in-use.
The repository already uses this tool.
Tool: renovatebot/renovate (https://github.com/renovatebot/renovate), AGPL-3.0, last activity 2026-11-15, maintained.
Proposed design
Problem statement
tf/azure/versions.tf pins the provider hashicorp/azurerm at ~> 3.100, and the newest release is 5.13. The pin alone fails: azurerm 4.0 takes the subscription id on the provider block (or from ARM_SUBSCRIPTION_ID) and renames default_node_pool.enable_auto_scaling to auto_scaling_enabled, and 5.0 is a further breaking release. The change sets ~> 5.13, applies the guide edits to tf/azure/main.tf and tf/azure/variables.tf, runs tofu init -backend=false && tofu validate in tf/azure with the OpenTofu 1.13.9 that the devcontainer image and the static CI job already install, and locks the edits with offline assertions in tests/security/test_tf_azure_aks_security.py. A permanent tofu validate row in the CI gate goes to a new issue, because the gate row, the provider lock file and its time budget are a change of their own.
Acceptance criteria
Requirement: Azurerm version pin
tf/azure/versions.tf SHALL pin the provider hashicorp/azurerm at ~> 5.13.
Scenario: Offline test reads the azurerm constraint
- WHEN the test reads the
versionof theazurermprovider intf/azure/versions.tf - THEN the value is exactly
~> 5.13
Requirement: Subscription id variable
tf/azure/variables.tf SHALL declare variable "subscription_id" with type string and default = null.
Scenario: Variable declares a null default
- WHEN the test reads
tf/azure/variables.tf - THEN exactly one
variable "subscription_id"block exists, and it setstype = stringanddefault = null
Requirement: Provider subscription id
The provider "azurerm" block in tf/azure/main.tf MUST set subscription_id from the input variable subscription_id.
Scenario: Provider block passes the variable
- WHEN the test reads the
provider "azurerm"block intf/azure/main.tf - THEN the block sets
subscription_id = var.subscription_id
Requirement: No literal subscription id
The provider "azurerm" block in tf/azure/main.tf MUST NOT hold a literal subscription id.
Scenario: Provider block holds no GUID literal
- WHEN the test scans the
provider "azurerm"block oftf/azure/main.tffor a UUID literal - THEN no UUID literal occurs in the block
Requirement: Node pool autoscaling field
The default_node_pool block of tf/azure/main.tf SHALL use auto_scaling_enabled and MUST NOT set enable_auto_scaling.
Scenario: Node pool uses the new name
- WHEN the test reads the
default_node_poolblock intf/azure/main.tf - THEN the block sets
auto_scaling_enabled = trueand holds noenable_auto_scaling
Requirement: Offline test module passes
tests/security/test_tf_azure_aks_security.py MUST pass with no network access.
Scenario: Run the security test module offline
- WHEN the test runner runs
tests/security/test_tf_azure_aks_security.pywith no network - THEN every test in the module passes, including the existing
network_profileand no-IP-literal assertions
Existing Tool Considered
renovatebot/renovate (https://github.com/renovatebot/renovate, AGPL-3.0, last activity 2026-11-15) is maintained, and the repository already runs it (docs/adr/0027-dependency-updates-come-from-self-hosted-renovate.md). It opens the pull request that raises hashicorp/azurerm in tf/azure/versions.tf to 5.x and keeps the pin current. It lacks the code migration: subscription_id on the provider block, the auto_scaling_enabled rename, the 5.0 removals, and the tofu validate run. minamijoyo/tfupdate only rewrites version constraints. The validation needs no new tool: OpenTofu 1.13.9 is already in the devcontainer image (.devcontainer/Dockerfile:206) and the static CI job (.github/workflows/ci.yml:80), so tofu init -backend=false && tofu validate covers the schema check. The change builds no code: it edits HCL and adds offline test assertions.
Key questions
- Which azurerm version does
tf/azurepin now, and which version does the change target?:tf/azure/versions.tf:7pinshashicorp/azurermat~> 3.100. The change sets~> 5.13, the newest release that the issue names. [sources: tf/azure/versions.tf:7] - Where does
tf/azure/main.tfhold the provider block and the autoscaling argument?: Theprovider "azurerm"block is attf/azure/main.tf:1and holds onlyfeatures {}. Thedefault_node_poolblock setsenable_auto_scaling = trueattf/azure/main.tf:56. [sources: tf/azure/main.tf:1, tf/azure/main.tf:56] - Which edits do the azurerm 4.0 and 5.0 upgrade guides require for
tf/azure?: The 4.0 guide renames the deprecateddefault_node_pool.enable_auto_scalingtoauto_scaling_enabledand moves the subscription id to the provider block orARM_SUBSCRIPTION_ID; it also renamesenable_node_public_iptonode_public_ip_enabled, whichtf/azure/main.tfdoes not use. The 5.0 guide is a further breaking-change guide for 4.x to 5.0. No hand-written list of the 5.0 removals is kept: the provider schema, checked bytofu init -backend=false && tofu validatewith azurerm 5.13, is the authority, and the change fixes each error that the run reports. [sources: https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/guides/4.0-upgrade-guide, https://library.tf/providers/hashicorp/azurerm/latest/docs/guides/4.0-upgrade-guide, https://github.com/hashicorp/terraform-provider-azurerm/blob/main/website/docs/guides/5.0-upgrade-guide.html.markdown] - Is OpenTofu installed in the devcontainer and in CI?: Yes. The issue premise is out of date. The devcontainer image installs OpenTofu 1.13.9 from the pin with a sha256 check (
.devcontainer/Dockerfile:206), the static CI job installs it withuv run devops install-tools --tool tofu --only-missing(.github/workflows/ci.yml:80), andopenspec/specs/devcontainer-image-tools/spec.md:67requires it in the runner image and the CI test job. So the change runstofu init -backend=false && tofu validateand needs no image work. [sources: .github/workflows/ci.yml:80, openspec/specs/devcontainer-image-tools/spec.md:67] - Does any CI check validate
tf/?: No. Thedevops cigate holds 26 rows (src/devops_cli/commands/ci.py:120) and none of them runstofu validateontf/; the archived proposal of build(deps): take every safe version update before Renovate #5065 records the same gap. That is why a permanent gate row is a new issue. [sources: src/devops_cli/commands/ci.py:120, openspec/changes/archive/2026-11-12-5065-take-every-safe-version-update-before/proposal.md:45] - How does the provider block get the subscription id?: Add
variable "subscription_id"withtype = stringanddefault = null, and setsubscription_id = var.subscription_idin the provider block. The null default keeps the provider'sARM_SUBSCRIPTION_IDfallback, andvariables.tfholds the declared input. (best practice) [sources: tf/azure/main.tf:1, tf/azure/variables.tf, https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/guides/4.0-upgrade-guide]- Chosen: Variable with
default = null. A null value keeps the provider'sARM_SUBSCRIPTION_IDfallback, andvariables.tfholds the declared input, as it does for every other input of the module. - Rejected: Variable with no default. It breaks the runs that set only
ARM_SUBSCRIPTION_ID. - Rejected: Literal subscription id. It writes a tenant value into a public repository.
- Rejected: Leave the block and rely on
ARM_SUBSCRIPTION_IDalone. The 4.0 guide accepts it, but the configuration then declares no input for the subscription.
- Chosen: Variable with
- Where do the offline checks of the Terraform files live?: Add the assertions to
tests/security/test_tf_azure_aks_security.py. (best practice) [sources: tests/security/test_tf_azure_aks_security.py:14, tests/security/test_tf_azure_aks_security.py:21]- Chosen: Extend
tests/security/test_tf_azure_aks_security.py. The module already readstf/azure/main.tfandtf/azure/variables.tfand asserts their AKS arguments, so the new assertions need no new file reads. - Rejected: New test module under
tests/security/. It duplicates the file reads and the fixtures of the existing module. - Rejected:
tofu validateCI job. No gate row validatestf/, and a new row is a change of its own; the offline assertions lock the edits in this change.
- Chosen: Extend
- How is the
tofu validategate delivered?: The change runstofu init -backend=false && tofu validateintf/azurewith the installed OpenTofu 1.13.9 and records the output in the pull request; a new issue adds the permanent CI gate. A hand-written list of the 5.0 removed fields is not kept, because the provider schema is the authority. (best practice) [sources: .github/workflows/ci.yml:80, .github/workflows/ci.yml:51, src/devops_cli/commands/ci.py:120]- Chosen: Run
tofu init -backend=false && tofu validatein this change and defer the CI row. OpenTofu 1.13.9 is already in the image and the static job, so the issue's done-when is reachable now; the gate row needs a provider lock file and a time budget of its own. - Rejected: Keep a hand-written list of the 5.0 removed fields in the offline test. The list is a hand-maintained copy of the upgrade guide and proves nothing about the 5.13 schema;
tofu validatereports the removed arguments itself. - Rejected: Add the
tofu validatestep to the static CI job now. The static job has a 6-minute timeout (.github/workflows/ci.yml:51),tf/azureholds no.terraform.lock.hcl, and the init downloads three providers; that work belongs in its own issue. - Rejected: Defer the whole validation. OpenTofu is installed in the devcontainer and in CI, so the run is possible now.
- Chosen: Run
Fit
Fits in one pull request.
Suspected block
None.
Dependencies
None.
Activity
dan-petty commentedon Nov 12, 2026
Both items edit tf/azure/main.tf, but the candidate upgrades the provider version while #4945 judges a Trivy AZU-0041 misconfiguration alert.build(deps): take every safe version update before Renovate (#5102)
devops-cli-service commentedon Nov 15, 2026
Alternatives check: in-use
Reason: The searches found no tool that performs the azurerm 3.x→5.x code migration: the upgrade guides are documentation, and tfupdate only rewrites version constraints. Renovate, which the issue already relies on (#4893), covers only the version-pin half by opening a pull request that raises
hashicorp/azurermto 5.x, leaving the breaking-change edits intf/azure/main.tfand thetofu validategate to a person.The repository already uses this tool.
Tool: renovatebot/renovate (https://github.com/renovatebot/renovate)
Covers:
hashicorp/azurermconstraint intf/azure/versions.tffrom~> 3.100to~> 5.13Lacks:
tf/azure/main.tffor the 4.0 breaking changes:provider "azurerm"needssubscription_id(orARM_SUBSCRIPTION_ID)default_node_pool.enable_auto_scalingtoauto_scaling_enabledazurerm_kubernetes_cluster,azurerm_subnetandazurerm_virtual_networkfields that the 5.0 guide dropstofu init -backend=false && tofu validateor add a CI job that validatestf/Tools 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: #6074.
dan-petty commentedon Nov 21, 2026
Closed as not planned. The hand-written
tf/azurestub, which this item upgrades to azurerm 5.x, was never applied. dan-petty/infra#9 rebuilds the AKS cluster on the Azure Verified Module at an exact registry version, and #6679 deletestf/azure. The provider pin then lives in infra, and Renovate updates it there (ADR 0032, #6674).