EVERYTHING XIAOMI
Get listed

terraform-compliance

terraform-compliance is a free, open-source framework for testing Terraform infrastructure code against security and compliance policies before deployment.

Place
#17 of 25
Score
5.9
terraform-compliance's website

What terraform-compliance is

terraform-compliance is a free, open-source framework for testing Terraform infrastructure code against security and compliance policies before deployment. It evaluates Terraform plan or state output, including plans converted to JSON, using policies written as behavior-driven feature files. A scenario uses Given steps to establish its context, When steps to filter that context, and Then steps to fail when conditions are unmet. Feature files can be loaded from a directory or a Git repository; SSH key authentication is available for private repositories. The project says it works with any Terraform provider and supports Terraform versions newer than 0.12. Checks can run in a pipeline or through git hooks, and documentation includes CircleCI and GitHub Actions examples. Installation is available through pip, which requires Python 3.x, or Docker. Controls can turn failures into warnings, fail scenarios when steps skip, enforce case-sensitive matching, or exclude resources. The project uses the MIT license and supports policy testing, admission control, and policy reporting, but not runtime enforcement.

Good

  • Works with any Terraform provider
  • Feature files can be stored in Git
  • Checks can run in pipelines or git hooks
  • Offers CircleCI and GitHub Actions examples
  • Free to use under the MIT license

Watch out

  • Requires Terraform plan or state output
  • pip installation requires Python 3.x
  • Does not provide runtime enforcement

Who it suits

It suits developers and security teams who want readable policy tests for Terraform plans and can supply plan or state output. Teams can also keep the feature files in a separate repository owned by another group.

Verdict

terraform-compliance gives teams a BDD-style way to check Terraform changes against security and compliance rules before deployment. It supports common CI workflows, but its scope is Terraform plan and state testing rather than runtime enforcement.

Plans and prices

From terraform-compliance's own pricing page, checked 4 Oct 2026.

All about pricing
PlanPriceWhat it gives you
terraform-complianceFreeOpen-source Terraform compliance testing framework

The facts

Each one read from terraform-compliance's own pages, with the date it was checked.

What it does

BDD behavior
Given steps set the test context, When steps filter it, and Then steps fail the scenario when their conditions are not met.checked 4 Oct 2026
CI integrations
The documentation includes CI/CD examples for CircleCI and GitHub Actions.checked 4 Oct 2026
Compliance controls
Supported tags include ways to turn failures into warnings, fail scenarios when steps skip, match case sensitively, and exclude resources.checked 4 Oct 2026
Feature sources
Feature files can be read from a directory or a Git repository, with SSH key authentication available for private repositories.checked 4 Oct 2026
Install options
The documentation provides installation through pip and Docker; pip installation requires Python 3.x.checked 4 Oct 2026
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.checked 4 Oct 2026
License
The maker’s site says the project is open source, free to use, and distributed under the MIT license.checked 4 Oct 2026
Policy tests
It tests Terraform plans against policies written as behavior-driven development features and scenarios.checked 4 Oct 2026
Provider support
The project says it works with any Terraform provider.checked 4 Oct 2026
Purpose
terraform-compliance is a lightweight, security- and compliance-focused test framework for negative testing of infrastructure as code written with Terraform.checked 4 Oct 2026
Terraform input
The tool requires a Terraform plan or state output as input and can also run against JSON-converted plan output.checked 4 Oct 2026
Terraform version support
The overview says terraform-compliance supports Terraform versions newer than 0.12.checked 4 Oct 2026
Validation timing
The project describes validating code before deployment and running checks in a pipeline or git hooks.checked 4 Oct 2026

Alternatives to terraform-compliance

All alternatives
  1. 1Terraform logo

    Terraform

    Free planWebAPILinuxmacOS
    8.0Free plan
  2. 2AWS CloudFormation logo

    AWS CloudFormation

    Free planiOSWebAPILinux
    7.7Free plan
  3. 3

    Kyverno

    Free planOpen sourceWebAPILinuxmacOS
    7.7Free plan
  4. 4Open Policy Agent Gatekeeper logo

    Open Policy Agent Gatekeeper

    Free planOpen sourceAPILinuxSelf-hosted
    7.2Free plan
  5. 5Fairwinds Polaris logo

    Fairwinds Polaris

    Free planWebLinuxmacOSSelf-hosted
    7.1Free plan
  6. 6

    Google Cloud Organization Policy

    Free planWebAPILinuxmacOS
    7.1Free plan