/huaweicloud-terraform-boilerplate

Minimal structure for Terraform projects using Huawei Cloud provider

Primary LanguageHCL

Huawei Cloud Terraform Boilerplate

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

Structure

  • main.tf - primary entrypoint
  • variables.tf - declarations for variables
  • outputs.tf - declarations for outputs
  • providers.tf - list required providers, versions and configurations
  • terraform.tfvars - derived from terraform.tfvars.example, contains custom values for variables. This file should not be commited to the repository.

Style Convention

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.

References