Skip to content

[AVM Module Issue]: hardcoded version pins in submodule _header.md usage examples go stale on every release #312

Description

@andyleejordan

Check for previous/existing GitHub issues

  • I have checked for previous/existing GitHub issues

Issue Type?

Bug

(Optional) Module Version

0.10.2

(Optional) Correlation Id

N/A

Description

Follow-up from #204 / PR #308.

PR #308 added consumer-facing usage examples to the submodule docs, each pinning the module version:

module "keyvault_secret" {
  source  = "Azure/avm-res-keyvault-vault/azurerm//modules/secret"
  version = "0.10.2"
  # ...
}

The version is hardcoded in modules/key/_header.md and modules/secret/_header.md. Nothing in the release process updates those files, so the moment 0.10.3 ships the published documentation advertises a stale pin. Every subsequent release widens the gap, and the drift is silent — the docs still generate cleanly and CI stays green, because terraform-docs copies _header.md verbatim into README.md without validating its contents.

This is not specific to the two files added in #308. It applies to any version pin baked into an _header.md anywhere in this repo, including the root _header.md if a usage example is ever added there. Worth solving generically rather than patching the two current instances.

Possible approaches (not prescriptive — whichever fits the AVM tooling best):

  1. Have the release automation rewrite version = "x.y.z" occurrences in _header.md files as part of the release commit, then regenerate docs.
  2. Replace the literal pin with a placeholder plus a pointer to the registry's version list, accepting that the example is then not copy-pasteable as-is.
  3. Add a CI check that fails when a version pin in an _header.md does not match the latest published release, converting silent drift into a visible failure.

Option 1 keeps the examples copy-pasteable and correct, which was the point of #204 in the first place, but it needs a hook in the release workflow. Option 3 is the cheapest to implement and at least makes the problem loud.

Files currently affected:

  • modules/key/_header.md
  • modules/secret/_header.md

Drafted by Claude Opus 5.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions