Let's examine how Terraform manages versioning with the dependency lock file. This file is similar to package-lock.json in npm or the requirements.txt in Python but has a few more features.
https://www.terraform.io/docs/language/dependency-lock.html
https://developer.hashicorp.com/terraform/language/expressions/version-constraints