Skill 2.1.2

Version constraint syntax

Key Concepts

Constraints are strings of one or more conditions separated by commas, such as ">= 5.0, < 7.0". The operators are = (or no operator) for an exact version, != to exclude a version, >, >=, < and <=, and ~>, the pessimistic constraint operator, which allows only the rightmost version component to increase.

~> 6.2 means at least 6.2 and below 7.0, so minor and patch updates are accepted. ~> 6.2.0 means at least 6.2.0 and below 6.3.0, so only patch updates are accepted. HashiCorp recommends that root modules use ~> to accept safe updates, and that reusable child modules set only a minimum version so that callers can choose.