
Why Version Constraints?
Use version constraints to:- Guarantee compatibility with existing state and modules
- Prevent accidental upgrades during CI/CD runs
- Enforce organizational compliance on approved tool versions
Always review your infrastructure modules and provider versions before updating constraints to avoid breaking changes.
Key Attributes
Terraform Version Constraint Example
Below is aterragrunt.hcl snippet that requires Terraform 1.8.4:
Terragrunt Version Constraint Example
To restrict the Terragrunt binary, addterragrunt_version_constraint. The following example allows any version greater than 0.58.0 and up to 0.58.11:
Locking to very specific versions can block legitimate upgrades. Plan your version bumps carefully and test in a staging environment.