A repository that acts as a template for Terraform modules.
Based on trussworks/terraform-module-template.
- Clone this repo, renaming appropriately.
- Write your terraform code in the root dir.
- Create an example of the module in use in the
examples
dir. - Ensure you've completed the Developer Setup.
- In the root dir, run
go mod init MODULE_NAME
to get a newgo.mod
file. Then rungo mod tidy
. This creates a newgo.sum
file and imports the dependencies and checksums specific to your repository. - Run your tests to ensure they work as expected using instructions below.
Please put a description of what this module does here
module "example" {
source = "terraform/registry/path"
<variables>
}
Name | Version |
---|---|
terraform | ~> 1.0 |
No providers.
No modules.
No resources.
No inputs.
No outputs.
Install dependencies (macOS)
brew install pre-commit go terraform terraform-docs
make ensure_pre_commit
Terratest is being used for
automated testing with this module. Tests in the test
folder can be run
locally by running the following command:
make test