CheckOps
terraform-compliance
terraform-compliance is an MIT, BDD-style test framework that checks Terraform plans against security and compliance rules written in Gherkin.
Latest public signals
Not refreshed yet. Refresh reads the public site and, when the entry has a GitHub repository, the latest release.
Introduction
terraform-compliance describes itself as a lightweight, security-focused BDD test framework against Terraform. You write rules as Gherkin feature files, for example ‘Given I have AWS S3 Bucket defined, Then it must contain server_side_encryption_configuration’, and run them against the JSON output of terraform plan.
Because it reads the plan rather than the source, it sees resolved values, module outputs and computed defaults. The plain-English steps make policies readable for auditors and security teams who do not write code.
In the quality loop it is a pre-apply gate in CI.
The source code is at terraform-compliance/cli on GitHub under the MIT licence, with about 1,500 stars; the most recent commit was on 22 October 2026.
Features
- Gherkin rules: Readable Given, When, Then policies.
- Plan-based: Evaluates resolved Terraform plan JSON.
- Negative testing: Express what must not exist.
- Docker image: Run without local Python setup.
- CI friendly: Non-zero exit on failed scenarios.
- Tags: Select subsets of rules.
Pros
- Readable for non-developers: Policies double as documentation.
- Free to use: Open source under the MIT licence, so the core tool costs nothing to use.
- Actively maintained: The repository had commits as recent as 22 October 2026.
Cons
- Narrow scope: Terraform only.
- Step vocabulary: You are limited to the provided step definitions.
- Smaller community: Fewer shared rule sets than Checkov or OPA.
Usage and Links (Example)
Feature: S3 encryption
Scenario: Buckets are encrypted
Given I have aws_s3_bucket defined
Then it must contain server_side_encryption_configuration
terraform plan -out plan.out && terraform show -json plan.out > plan.json
terraform-compliance -p plan.json -f ./compliance
Resources:
Pricing
terraform-compliance is free and open source under the MIT licence.
Recommended for?
- Security teams that want readable Terraform policies.
- Regulated environments that must show auditors what is enforced.
Conclusion
terraform-compliance makes Terraform policy readable to everyone.
Choose it when readability matters more than policy-language power.
On CheckOps, terraform-compliance is filed under the Release & CI gates and Security testing stages. Related tools listed here include Terratest, Test Kitchen, Molecule, Goss, Chef InSpec and Container Structure Test. Which one fits best depends mostly on your stack, your team’s size and skills, and whether you prefer to run tools yourself or pay for a managed service. This page reflects the official website, documentation and repository as they stood on 11 November 2026.
Alternatives
Other tools on CheckOps that cover similar ground. Open a page, or compare one with terraform-compliance side by side.
TTerratestTerratest is an Apache-2.0 Go library from Gruntwork for writing automated tests that deploy real Terraform, Packer, Docker and Kubernetes infrastructure, validate it and tear it down.Compare with terraform-compliance
TTest KitchenTest Kitchen is an Apache-2.0 integration testing harness that converges infrastructure code on isolated platforms such as Docker, Vagrant and cloud VMs, then runs verifiers like InSpec.Compare with terraform-compliance
MMoleculeMolecule is an MIT Ansible-native testing framework for roles, playbooks and collections, creating test instances, converging them and running verification and idempotence checks.Compare with terraform-compliance
GGossGoss is an Apache-2.0 YAML-based tool for quick server and container validation, checking packages, files, ports, services and HTTP endpoints, with dgoss for Docker images.Compare with terraform-compliance
CChef InSpecChef InSpec is an auditing and testing framework with a Ruby-based DSL for checking that servers, containers and cloud resources meet compliance and security requirements.Compare with terraform-compliance
CContainer Structure TestContainer Structure Test is an Apache-2.0 tool from Google for validating the structure of container images: commands, file contents, metadata and existence checks defined in YAML.Compare with terraform-compliance