Terraform tips, notes, and best practices
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2026-10-12 11:21:14 +02:00
modules/example_module Merge pull request #2 from small-hack/renovate/google-4.x 2023-07-21 20:22:26 +02:00
.gitignore basic terraform formatting, validating, linting, and docs with precommit hooks 2023-02-18 15:07:14 +01:00
.pre-commit-config.yaml basic terraform formatting, validating, linting, and docs with precommit hooks 2023-02-18 15:07:14 +01:00
LICENSE update open engineering references 2026-10-12 11:21:14 +02:00
README.md basic terraform formatting, validating, linting, and docs with precommit hooks 2023-02-18 15:07:14 +01:00
renovate.json Add renovate.json 2023-07-21 17:08:58 +00:00

Example base terraform module

Here's where we'll put some example base terraform modules and best practices.

Precommit Hooks

We'll be using pre-commit-terraform to keep the code tidy!

The precommit hooks help with:

  • formatting the code
  • validating the code
  • linting the code
  • documenting the code
  • security scanning, probably...?
  • maybe even infra cost checking 🤷

Install Dependencies

  • tflint
  • jq
  • terraform-docs
  • pre-commit
  • checkov (I haven't tested this one)
  • infracost (not tested)

To install the pre-commit hooks for this repo use:

Setup Precommit for the first time after cloning locally

# initialize terraform for the first time
terraform init

# run this from the root directory of the repo
pre-commit install

To test the pre-commit hooks for this repo use:

# run this from the root directory of the repo
pre-commit run