antonbabenko / terraform-best-practices

Terraform Best Practices free ebook translated into 🇬🇧🇦🇪🇧🇦🇧🇷🇫🇷🇬🇪🇩🇪🇬🇷🇮🇱🇮🇳🇮🇩🇮🇹🇯🇵🇰🇷🇵🇱🇷🇴🇨🇳🇪🇸🇹🇷🇺🇦🇵🇰
https://www.terraform-best-practices.com/
Other
2.07k stars 431 forks source link

Add section dedicated to versions.tf #50

Open mloskot opened 1 year ago

mloskot commented 1 year ago

Handling of versions.tf is simple in a simple single directory/module project, but as a project becomes complex, starts using in-house as well as third-party modules, then versions.tf raise numerous questions on where those are needed, where recommended, etc.

@apparentlymart offered an excellent explanation in the How to set up versions.tf at root level of directory thread:

The key thing to note here is that the version constraints are a per-module idea and so should ideally be included in every directory that contains .tf files, describing which Terraform and provider versions each specific module is compatible with. There is no expectation that all of your modules would declare the same requirements, because each one will be using different features of Terraform and different provider features.

I think this deserves a place in any collection of Terraform best practices.