pre-commit-terraform
A collection of pre-commit hooks for Terraform.
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)
✅ 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
✅ Offline Mode Available
🔌 Integrations
💰 Pricing
Free tier: Fully open-source and free.
🔄 Similar Tools in Pre-Commit IaC Scanning
Checkov
Open-source IaC scanner that finds misconfigurations in Terraform, CloudFormation, Kubernetes, and m...
Terrascan
Open-source static code analyzer for IaC that helps detect security issues and compliance violations...
KICS
Open-source IaC scanner from Checkmarx that supports a wide range of platforms and offers extensive ...
Trivy
Versatile open-source security scanner from Aqua Security that finds vulnerabilities, IaC misconfigu...
tfsec
A fast, open-source static analysis scanner for Terraform code to find security misconfigurations....
Prisma Cloud
A comprehensive Cloud Native Application Protection Platform (CNAPP)....