🗂️ Navigation

pre-commit-terraform

A collection of pre-commit hooks for Terraform.

Visit Website →

Overview

pre-commit-terraform is not a single tool, but a curated collection of Git pre-commit hooks for managing and maintaining Terraform code. It leverages the `pre-commit` framework to run a series of checks automatically whenever a developer tries to commit code. This includes running formatters, validators, linters, and security scanners like TFLint and tfsec, ensuring that code pushed to the repository meets quality and security standards.

✨ Key Features

  • Integrates multiple Terraform tools into a single pre-commit workflow
  • Includes hooks for `terraform fmt`, `terraform validate`
  • Includes hooks for security scanners like `tfsec` and `checkov`
  • Includes hooks for linters like `tflint`
  • Automates documentation generation with `terraform-docs`

🎯 Key Differentiators

  • Provides a comprehensive, ready-to-use suite of hooks for Terraform
  • Simplifies the setup of a robust local testing workflow
  • Maintained by a well-known figure in the Terraform community

Unique Value: Drastically improves developer productivity and code quality by automating a suite of best-practice Terraform checks directly within the Git workflow.

🎯 Use Cases (3)

Automating quality and security checks for Terraform developers locally Enforcing consistent formatting and style across a team Catching errors and security issues before code is even pushed to a remote repository

✅ Best For

  • Creating a standardized local development workflow for Terraform projects.

💡 Check With Vendor

Verify these considerations match your specific requirements:

  • Server-side policy enforcement (as pre-commit hooks can be bypassed by developers).

💻 Platforms

Desktop

✅ Offline Mode Available

🔌 Integrations

pre-commit Git tfsec tflint checkov terraform-docs

💰 Pricing

Contact for pricing
Free Tier Available

Free tier: Fully open-source and free.

Visit pre-commit-terraform Website →