version constraint

A string such as "~> 3.6" or ">= 1.6.0" that says which versions of Terraform, a provider or a module are acceptable.

In more detail

A bare number means exactly that version; >= means that version or anything newer, including breaking major releases. Several conditions can be combined with commas, such as ">= 3.6, < 4.0". The lock file records the exact version chosen, so the constraint only matters when you deliberately upgrade.

Examples

version = "3.6.0"        # exactly
version = ">= 3.6, < 4.0"

Related terms

Taught in

References

Certification courses