fix: correct the Terraform version floors for the examples - #77
Merged
Conversation
The root module and its examples do not need the same Terraform version. Verified by loading each directory with the oldest binary its own constraint permits, so the values come from Terraform rather than from reading the HCL.
ben-vaughan-nttd
approved these changes
Aug 4, 2026
ben-vaughan-nttd
left a comment
Contributor
There was a problem hiding this comment.
Version-floor review: root required_version matches root HCL; root README Requirements stay in sync with versions.tf. Example floor changes are scoped to examples/complete and are not a manual review gate. CI is green.
rakesh-gorige-nttd
approved these changes
Aug 4, 2026
rakesh-gorige-nttd
left a comment
There was a problem hiding this comment.
LGTM — example required_version aligned to transitive module constraints. Root floor unchanged and still accurate for this module HCL.
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
Corrects
required_versionwhere the declared Terraform floor does not match what the code actually requires.|
examples/already_zipped|~> 1.0|~> 1.5||
examples/from_folder|~> 1.0|~> 1.5||
examples/pip_install_pyproject|~> 1.0|~> 1.5||
examples/pip_install_requirements|~> 1.0|~> 1.5|Why this is wrong today
A consumer on a version inside the declared range satisfies the constraint and then hits a hard parse error, so the constraint misleads instead of protecting.
make lintcannot catch it, because it validates with the.tool-versionsTerraform rather than the declared floor, and CI runs a recent version that satisfies every floor.Where an example needs more than the root, the requirement usually comes from a module it consumes — most examples use
resource_name, which declares~> 1.5. That is invisible in this repository's own HCL and only appears when the example is initialized.The rule being applied
An example must declare at least the root's floor, and may declare more. Terraform enforces every
required_versionin the module tree and takes the maximum, so an example declaring less is stating something untrue about itself — but the root should not be dragged up to cover what an example imports, since consumers use the root module. Enforced bylaunch-terraform-skeleton#40.Verification
Each directory was loaded with
terraform init -backend=false && validateusing the oldest version its constraint permits, before and after. The full fleet survey covered all 95 converted repos; 31 needed a correction.READMEs are updated because
terraform-docsrendersrequired_versioninto the Requirements table and the pre-commit hook fails on a stale one.Impact
Not a practical breaking change: nobody below the corrected floor could have been using this successfully, so no working consumer loses anything. Ceilings are unchanged.
Generated with Cursor Agent (Opus 5)