
version argument in the module block. For example, to pin the module to version 5.12.0:
terraform init, Terraform will download the specified module version (5.12.0 in this example) and continue to use that version for plan and apply operations.
If you prefer to allow non-breaking updates but avoid major bumps, use version constraints. The table below summarizes common patterns and their behavior.
When you decide to adopt a newer module release (for example, moving from 5.12.0 to 5.14.0), update the
version in the module block and run terraform init -upgrade to re-download the module:
- Pin module versions or use constrained ranges to reduce risk from breaking changes.
- Test module upgrades in non-production environments before promoting to production.
- Read the module’s CHANGELOG and release notes to understand breaking changes and migration steps.
- Consider using CI pipelines to validate
terraform planafter upgrading module versions.
Pin module versions (or use constrained version ranges) and test module upgrades in non-production environments before promoting them to production. This reduces the risk of unexpected breaking changes.
- Terraform Registry
- Semantic Versioning (semver)
- Terraform CLI:
terraform init,terraform init -upgrade