Skip to content

rajpawar02/terraform-module-template

 
 

Repository files navigation

Truss Terraform Module template

This repository is meant to be a template repo we can just spin up new module repos from with our general format.

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

Terraform Versions

This is how we're managing the different versions. Terraform 0.13. Pin module version to ~> 2.0. Submit pull-requests to master branch.

Terraform 0.12. Pin module version to ~> 1.0.1. Submit pull-requests to terraform012 branch.

Terraform 0.11. Pin module version to ~> 1.0. Submit pull-requests to terraform011 branch.

Usage

Put an example usage of the module here

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

  <variables>
}

Requirements

Name Version
terraform >= 0.13
aws ~> 3.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
pre-commit install --install-hooks

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

Or with aws-vault:

AWS_VAULT_KEYCHAIN_NAME=<NAME> aws-vault exec <PROFILE> -- make test

About

Template repo with Terraform module basics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Shell 42.4%
  • Go 32.8%
  • Makefile 16.2%
  • HCL 8.6%