A module declares version = "~> 5.3" for a provider in required_providers. Which provider versions does this constraint allow?
Select an answer to reveal the explanation.
Short Explanation
The pessimistic operator lets only the rightmost number you wrote move. Write 5.3 and the minor version can climb, but the major stays put at 5. The trap is reading it as patch-only, which is what you'd get by writing three numbers.
Full Explanation
The ~> operator, often called the pessimistic constraint operator, allows only the rightmost version component in the constraint to increase. With two components, ~> 5.3 allows the minor version to grow while holding the major version, which means versions from 5.3.0 up to, but not including, 6.0.0. Writing three components, such as ~> 5.3.0, would instead hold the minor version and allow only patch releases from 5.3.0 to below 5.4.0, which is the behaviour the patch-only reading describes. An exact pin is written with = or a bare version number, not with ~>. A constraint without an upper bound is written with >= alone, and it would admit a future major version with breaking changes, which ~> is specifically designed to prevent. Within the allowed range, terraform init chooses the newest available version the first time and then records the selection in the dependency lock file, so the constraint sets the boundaries while the lock file fixes the exact choice. Exam caveat: HashiCorp recommends that reusable modules specify only minimum versions with >= and leave tighter pins to the root module. Operational check: run terraform version and terraform providers after init to see the selected version, and inspect the lock file to confirm it falls in the expected range.