terragrunt `terraform.version` resolves `tfr://` modules from a constraint
Introduced 2026-07-14 · score 0.93
HOW TO USE IT
For a `tfr://` registry module in Terragrunt v1.1.1, enable the `version-attribute` experiment and set `version` to a constraint; Terragrunt resolves the highest published match before downloading. Do not also set `?version=` on that source.
terraform {
source = "tfr://registry.opentofu.org/terraform-aws-modules/vpc/aws"
version = "~> 3.3"
}terragrunt --experiment version-attribute run -- initWHY THIS HELPS
Pin a registry module in a Terragrunt configuration using a version constraint.
REQUIREMENTS AND LIMITATIONS
- Version: v1.1.1
- Availability: Experimental; gated by the `version-attribute` experiment.
- --experiment version-attribute (required): Enables the `version` attribute experiment in v1.1.1.
- terraform.source (required): The module source; the `version` attribute applies only to `tfr://` sources.
- terraform.version (required): A version constraint for resolving a `tfr://` module. Do not combine it with inline `?version=` on the same source; the docs say this combination is an error.
- Prerequisite: Use Terragrunt v1.1.1 or later; in v1.1.1 the `version-attribute` experiment must be enabled with `--experiment version-attribute` or `TG_EXPERIMENT=version-attribute`.
- The `version` attribute applies to `tfr://` sources only.
- It cannot be combined with an inline `?version=` on the same source.
- Docs conflict: The currently published docs describe later behavior: they say the experiment is no longer needed by default and is scheduled to complete in v1.2.0. The v1.1.1 release note says the flag is required, so use the release-note behavior for v1.1.1.
FIRST-PARTY EVIDENCE
- https://github.com/gruntwork-io/terragrunt/releases/tag/v1.1.1
- https://docs.terragrunt.com/reference/hcl/blocks/
Check the installed version and the source before using it. Entry JSON