Modules are Terraform configurations that allow you to manage a group of resources and can provide better business abstraction and lower costs in some multi-resource scenarios. In addition, you can publish modules on GitHub to the Terraform registry. This document describes how to create and publish a Terraform TencentCloud module.
Create a code repository on GitHub and name it in the format of
terraform-<provider>-<name>, such as terraform-tencentcloud-vpc.
A basic module contains the following files:
. ├── main.tf # Write module resources ├── variables.tf # Declare module variables ├── outputs.tf # Declare module outputs ├── LICENCE # Declare license └── README.md # Readme
You are advised to add the
examples directory to store the examples for importing and using the module. For more information, visit.
Note: You can also publish a module through a personal GitHub repository. The modules whose repositories are named in the format of
terraform-tencentcloud-<name> will also be included in the tencentcloud modules.