Essentials
- Use remote state and state locking
- Agree on naming convention
- Use tags
As a common sense, it’s highly recommended to reuse some matured modules such as VPC https://registry.terraform.io/
- Keep your providers, modules versioned properly
- Keep each module in a separate repo. Usually it depends on project size, and we can use monorepo or single modules repo as well.
-
Use pre-commit https://pre-commit.com/#install https://github.com/antonbabenko/pre-commit-terraform
-
Must have hooks:
- terraform_fmt
- terraform_validate
- terraform_docs
- terraform_tflint
-
DRY (Don’t repeat yourself) to be continued…