How do version constraints like `~>`, `>=` and `!=` work?
IntermediateConceptIaC and Terraform Fundamentals
Answer
= 1.2.3 pins exactly; >= 1.2 sets a floor; ~> 5.1 allows 5.x where x is 1 or higher (the rightmost digit may increase); ~> 5.1.0 allows only 5.1.x; != 5.3.0 excludes a bad release. Constraints can be combined with commas. For modules and providers we use ~> to take patches and minors but not majors.
More on IaC and Terraform Fundamentals
What is Infrastructure as Code and why do teams use it?BeginnerWhat is the difference between declarative and imperative infrastructure tools?BeginnerWhat is Terraform and what problem does it solve?BeginnerWhat is HCL and can Terraform use anything else?BeginnerWhich files make up a typical Terraform root module?BeginnerHow does Terraform work internally?Advanced