Skip to content
SPECIFICTION
Get listed

Conftest vs Google Cloud Terraform Policy Validation

Conftest

conftest.dev

Google Cloud Terraform Policy Validation

docs.cloud.google.com

Side by side

FigureConftestGoogle Cloud Terraform Policy Validation
Price fromFreeFree
Free planYesYes
Free trial——
Open source——
WindowsYesYes
macOSYesYes
LinuxYesYes
Plans published11
Spec score · Infrastructure Policy as Code Tools8.5 (#5)8.5 (#6)
PurposeConftest is a utility for writing tests against structured configuration data.gcloud beta terraform vet enforces policy compliance as part of an infrastructure CI/CD pipeline.
SupportQuestions and discussions are directed to the Open Policy Agent Slack channel `#opa-conftest`.Until gcloud beta terraform vet is generally available, users are directed to open support tickets in the terraform-google-conversion GitHub repository.

Plans

Conftest

  • Open-source ConftestFree

Conftest pricing →

Google Cloud Terraform Policy Validation

  • gcloud beta terraform vetFree

Google Cloud Terraform Policy Validation pricing →

In their own words

Conftest

Conftest is a free utility for testing structured configuration data, designed for use in CI environments. It uses the Open Policy Agent Rego language to express policies, then evaluates deny, violation, and warning rules within namespaces. Configuration can be read from individual files, directories, multiple files, or standard input. Supported inputs include Kubernetes-style YAML, JSON, HCL and HCL2, Dockerfiles, Terraform-related data, JSONnet, TOML, and XML. Results can be output as plaintext, JSON, TAP, table, JUnit, GitHub, Azure DevOps, or SARIF; the GitHub outputter can annotate test results in workflows. The `conftest verify` command runs policy unit tests. Policies can be pulled from HTTPS URLs, Git repositories, and OCI registries, or pushed to compatible OCI registries. Plugins extend the CLI, with downloads available from sources including OCI, Git, HTTP/HTTPS, Mercurial, and cloud storage. Pre-commit hooks support policy workflows, and integrations are documented for CircleCI, GitHub Actions, and Tekton. Conftest is available for Linux, macOS, and Windows.

Visit conftest.dev

Google Cloud Terraform Policy Validation

Google Cloud Terraform Policy Validation checks Terraform plans against organizational security and governance constraints before infrastructure changes are applied. The `gcloud beta terraform vet` command evaluates Terraform plan JSON, retrieving project data through Google Cloud APIs. It can flag violations, issue warnings, or halt a deployment before production; it returns exit code 0 when no violations are found and 2 when they are. Platform teams can place validation between plan and apply in CI/CD workflows using Cloud Build, Jenkins, or GitHub Actions. The command accepts Terraform 0.12 or later plan JSON and requires a policy library and the Google Cloud CLI `terraform-tools` component. Policies can cover supported resources from Terraform's google and google-beta providers, and constraints can be reused with other tools that support the framework. The command is free and client-side. The feature is in Preview under Pre-GA terms, where support may be limited. Security Command Center IaC validation has separate requirements: Premium or Enterprise activation at the organization level and a specified role. That workflow also requires Terraform Google provider version 5.5 or later.

Visit docs.cloud.google.com