Skip to content

codeforamerica/tofu-modules-template

Repository files navigation

Code for America OpenTofu Module Template

GitHub Release

Use this template repository to create new OpenTofu modules. Follow the steps below to use this repository:

  1. Click the "Use this template" button to create a new repository
  2. Name your new repository using the format todu-modules-<provider>-<module>
  3. Update the repository Pull Requests settings to allow only squash merging with a default commit message of "Pull request title and commit details" for automated releases
  4. Add the files necessary to support your module to the root of your new repository
  5. Update the README.md file with the appropriate information for your module. Make sure you update any references to this template repository with your new repository
  6. Update the codeforamerica/tofu-modules repository to include your new module in the main README.md and the documentation

Usage

Add this module to your main.tf (or appropriate) file and configure the inputs to match your desired configuration. For example:

module "module_name" {
  source = "github.com/codeforamerica/tofu-modules-template?ref=1.0.0"

  project = "my-project"
  environment = "development"
}

Make sure you re-run tofu init after adding the module to your configuration.

tofu init
tofu plan

To update the source for this module, pass -upgrade to tofu init:

tofu init -upgrade

Inputs

Name Description Type Default Required
project Name of the project. string n/a yes
environment Environment for the project. string "dev" no
tags Optional tags to be applied to all resources. list [] no

Outputs

Name Description Type
id Id of the newly created resource. string

Contributing

This repository uses pre-commit to enforce code style checks before each commit. Install it once after cloning:

1. Install pre-commit

brew install pre-commit

2. Install the git hook

pre-commit install

This symlinks the hook into .git/hooks/pre-commit. The checks will now run automatically on every git commit. To run them manually against all files:

pre-commit run --all-files

Follow the contributing guidelines to contribute to this repository.

About

Code for America template for OpenTofu mofules.

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors