This project contains a minimal structure for Terraform projects using Huawei Cloud provider, following some practices and references found around the web (listed at the end).
Huawei Cloud Terraform provider documentation
main.tf
- primary entrypointvariables.tf
- declarations for variablesoutputs.tf
- declarations for outputsproviders.tf
- list required providers, versions and configurationsterraform.tfvars
- derived fromterraform.tfvars.example
, contains custom values for variables. This file should not be commited to the repository.
In order to ensure consistency across your project, follow some conventions:
- Use 2 spaces for indentation
- Align the equal signs inside a block
- Use empty lines to separate blocks
- Use only lowercase letters, digits and underscores (
_
) in resource identifiers. Do not use hyphens (-
)
Except for identifiers naming, all the other conventions are automatically
applied by running terraform fmt
command.
- Terraform's Standard Module Structure
- Digital Ocean's How To Structure a Terraform Project
- Terraform's Style Conventions
- Google Cloud's Best practices for using Terraform