Skip to content

knoedel/terraform-module-template

Repository files navigation

Terraform Module Template

A repository that acts as a template for Terraform modules.

Based on trussworks/terraform-module-template.

Creating a new Terraform Module

  1. Clone this repo, renaming appropriately.
  2. Write your terraform code in the root dir.
  3. Create an example of the module in use in the examples dir.
  4. Ensure you've completed the Developer Setup.
  5. In the root dir, run go mod init MODULE_NAME to get a new go.mod file. Then run go mod tidy. This creates a new go.sum file and imports the dependencies and checksums specific to your repository.
  6. Run your tests to ensure they work as expected using instructions below.

Actual readme below - Delete above here

Please put a description of what this module does here

Usage

Put an example usage of the module here

module "example" {
  source = "terraform/registry/path"

  <variables>
}

Requirements

Name Version
terraform ~> 1.0

Providers

No providers.

Modules

No modules.

Resources

No resources.

Inputs

No inputs.

Outputs

No outputs.

Developer Setup

Install dependencies (macOS)

brew install pre-commit go terraform terraform-docs
make ensure_pre_commit

Testing

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