Best Practices
- Terraform modules, incl. root modules, hold following files
versions.tf- contains the terraform block with the attributes required_version and required_providersmain.tf- contains the module codevariables.tf- contains all module variablesoutputs.tf- contains all output objectsREADME.md- Contains at least a short description of the module, examples of usage and the description of the module generated by terraform-docs
- Terraform root modules hold following files
backend.tf- contains the terraform backend configuration (could be generated by terragrunt)provider.tf- contains the configurations of the individual providers (could be generated by terragrunt)versions.tf- contains the terraform block with the attributes required_version and required_providersmain.tf- contains the module codevariables.tf- contains all module variablesoutputs.tf- contains all output objects
- Terraform resource names are written in
snake_case - Variables are always defined with
typeanddescription - Outputs are always defined with
valueanddescription - Terraform version and plugin versions are pinned to specific version and specifically updated