The goal of this page is to list some useful tooling for Terragrunt/Terraform.
Good code quality is a must-have for any project
terraform fmt -recursive -diff -write=true
terragrunt hclfmt
Left shift security related tasks as much as possible
checkov -d . --framework terraform --skip-file baseline.skip
tfsec .
terrascan scan -i terraform -d .
Documentation is a must-have for any project
terraform-docs markdown .
When working with Terraform and even more so for Terragrunt, reading plan can be a pain. Terraform is not fixing it any time soon : Github issue on concise plan
terraform plan -no-color | grep -E '(^.*[#~+-] .*|^[[:punct:]]|Plan|Changes)'
For terraform fmt, terragrunt hcl and checkov you can use the following configuration :
repos:
- repo: https://github.com/antonbabenko/pre-commit-terraform
rev: v1.77.0
hooks:
- id: terraform_fmt
- id: terragrunt_fmt
- id: terraform_checkov
args:
- --args=--quiet
- --args=--framework=terraform
- id: terraform_providers_lock
args:
- --hook-config=--mode=only-check-is-current-lockfile-cross-platform
For tflint check here