Skip to content

Latest commit

 

History

History
42 lines (31 loc) · 949 Bytes

README.md

File metadata and controls

42 lines (31 loc) · 949 Bytes

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