Terraform is an open-source infrastructure as a code software tool that enables you to safely and predictably create, change, and improve infrastructure. At Heline we are using Terraform heavily for our clients' IaC codebase.
In this blog post, we will list our favourite open-source tools that supercharge our Terraform codebase development:
terraform-docs
website: terraform-docs
Generate Terraform modules documentation in various formats
tflint
website: tflint
TFLint is a framework and each feature is provided by plugins, the key features are as follows:
- Find possible errors (like illegal instance types) for Major Cloud providers (AWS/Azure/GCP).
- Warn about deprecated syntax and unused declarations.
- Enforce best practices, and naming conventions.
.tflint.hcl file we are using:
tfsec
website: tfsec
tfsec is a static analysis security scanner for your Terraform code.
Features:
- ☁️ Checks for misconfigurations across all major (and some minor) cloud providers
- ⛔ Hundreds of built-in rules
- 🪆 Scans modules (local and remote)
- ➕ Evaluates HCL expressions as well as literal values
- ↪️ Evaluates Terraform functions e.g. concat()
- 🔗 Evaluates relationships between Terraform resources
- 🧰 Compatible with the Terraform CDK
- 🙅 Applies (and embellishes) user-defined Rego policies
- 📃 Supports multiple output formats: CLI, JSON, SARIF, CSV, CheckStyle, and JUnit.
- 🛠️ Configurable (via CLI flags and/or config file)
- ⚡ Very fast, capable of quickly scanning huge repositories
infracost
website: infracost
Cloud cost estimates for Terraform in pull requests
Infracost helps engineers see cloud costs before launching resources. Map costs to code directly in pull requests. Take action directly in your workflow.
driftctl
website: driftctl
driftctl is a free and open-source CLI that warns of infrastructure drift and fills in the missing piece in your DevSecOps toolbox.
Extra tools:
there are quite cool and useful tools beside the upper list, including:
- pre-commit
- checkov - cloudrail
- terragrunt - terraspace - terramate - cluster.dev
- terratest - inSpec
- tfenv - tfswitch - tgenv