terraform-compliance
terraform-compliance.com
- Free plan
- Linux
- Self-hosted
What terraform-compliance is
terraform-compliance is a free, open-source framework for testing Terraform infrastructure as code against security and compliance policies. It requires Terraform plan or state output and can also use JSON-converted plan output. Policies are written as behavior-driven feature files with Given, When, and Then steps: context is established, resources are filtered, and unmet conditions fail scenarios. The project says it works with any Terraform provider and Terraform versions newer than 0.12. Checks can run before deployment, in CI/CD pipelines, or through git hooks. Feature files come from a directory or Git repository, with SSH authentication for private repositories. Installation is available through pip, requiring Python 3.x, or Docker. Documentation includes CircleCI and GitHub Actions examples. Controls include warnings, skipped-step failures, case-sensitive matching, and resource exclusions.
Who it suits
It suits developers and security teams writing readable Terraform compliance policies. Teams that separate policy files into another repository or run checks in pipelines can use it.
Good to know, and what to watch
- Free under the MIT license
- Uses readable BDD-style policy files
- Works with any Terraform provider
- Runs in pipelines or git hooks
- Supports directory and Git policy sources
- Requires Terraform plan or state input
- pip installation requires Python 3.x
- Supports Terraform versions newer than 0.12
- Does not provide runtime enforcement
Plans
Every plan and priceterraform-compliance
Free plan
The verdict
terraform-compliance offers focused policy testing for Terraform plans and state, with flexible policy sources and CI integrations. It is suited to pre-deployment and pipeline checks rather than runtime enforcement.
What the maker publishes
- BDD behavior
- Given steps set the test context, When steps filter it, and Then steps fail the scenario when their conditions are not met. source
- CI integrations
- The documentation includes CI/CD examples for CircleCI and GitHub Actions. source
- Compliance controls
- Supported tags include ways to turn failures into warnings, fail scenarios when steps skip, match case sensitively, and exclude resources. source
- Feature sources
- Feature files can be read from a directory or a Git repository, with SSH key authentication available for private repositories. source
- Install options
- The documentation provides installation through pip and Docker; pip installation requires Python 3.x. source
- Intended users
- The project describes policies that developers and security teams can read and says tests can be kept in a separate repository owned by another team. source
- License
- The maker’s site says the project is open source, free to use, and distributed under the MIT license. source
- Policy tests
- It tests Terraform plans against policies written as behavior-driven development features and scenarios. source
- Provider support
- The project says it works with any Terraform provider. source
- Purpose
- terraform-compliance is a lightweight, security- and compliance-focused test framework for negative testing of infrastructure as code written with Terraform. source
- Terraform input
- The tool requires a Terraform plan or state output as input and can also run against JSON-converted plan output. source
- Terraform version support
- The overview says terraform-compliance supports Terraform versions newer than 0.12. source
- Validation timing
- The project describes validating code before deployment and running checks in a pipeline or git hooks. source
Checked against the maker's pages on 4 Oct 2026.