kral2 / terraform-generic-template

Terraform Configuration boilerplate with linting, automatic documentation, .gitignore file, etc.
MIT License
7 stars 1 forks source link
boilerplate terraform

terraform-generic-template

About

This is a template repo acting as a boilerplate for new Terraform configs. It contains a set of files that will help you keep the repo clean and well-documented.

How to use it

The best way to use this template is by using the GitHub CLI (gh). It allows you to create a new Terraform config repository from this template, without leaving your terminal.

The advantage over a classical fork is that the resulting repo has no relationship with the template repo, no upstream remote to clean.

A simple example to create a new config as a private repo, and clone it locally:

gh repo create my-tf-config --template kral2/terraform-generic-template --private --clone

[!IMPORTANT]

Do not forget to update your files to make this config yours!

  • repo's documentation and license: README.md, CHANGELOG.md, and LICENSE files
  • the *.tf files: main.tf, providers.tf, and variables.tf

Finally, install your pre-commit hooks by running these commands:

pre-commit install
pre-commit run -a

Now, commit your code as usual. You are good to go! :rocket:

Features

repo housekeeping

pre-commit hooks

Before each commit, the following hooks will help to keep your repo clean and well-documented:

Terraform config files

Requirements

Terraform Configuration information

Requirements

Name Version
terraform >= 1.5.0

Modules

No modules.

Resources

No resources.

Inputs

Name Description Type Default Required
default_tags a set of tags to watermark the resources you deployed with Terraform. map(string)
{
"owner": "cetin",
"terraformed": "Do not edit manually."
}
no

Outputs

No outputs.