EVERYTHING XIAOMI
Get listed
Terratest logo

Terratest

Terratest is a free, open-source Go library for writing automated tests for infrastructure code.

Place
#12 of 28
Score
6.2
Terratest's website

What Terratest is

Terratest is a free, open-source Go library for writing automated tests for infrastructure code. Its helpers cover Terraform, OpenTofu, Terragrunt, Packer, Helm, Docker, and Kubernetes, with APIs for AWS, Azure, and GCP. Tests can run infrastructure tools, deploy real resources, check the resulting environment, and remove those resources afterward. Built-in validation can use HTTP requests, API calls, SSH connections, and shell commands. The documentation covers unit, integration, and end-to-end testing, along with parallel execution, retries, error handling, and static analysis. Terratest runs locally and includes configuration-compliance, provisioning, deployed-check, and policy-as-code capabilities. The library is released under the Apache 2.0 License. The quick start requires Go 1.26 or later and OpenTofu or Terraform for its examples. The documentation recommends cleaning up after tests because they can create resources in real environments. Users can ask questions in GitHub Discussions or report bugs and request improvements through GitHub Issues; Gruntwork offers commercial support to companies relying on Terratest in production. The v1 line receives security fixes only while v2 is in development.

Good

  • Open source under the Apache 2.0 License
  • Supports multiple infrastructure tools and cloud APIs
  • Includes unit, integration, and end-to-end testing guidance
  • Validates deployed infrastructure through HTTP, APIs, or SSH

Watch out

  • Quick start requires Go 1.26 or later
  • Tests can deploy real resources that need cleanup
  • The v1 line receives security fixes only

Who it suits

Terratest suits teams writing tests for infrastructure code, including projects built with Terraform, Packer, Docker, and Kubernetes. It requires Go 1.26 or later for the quick start.

Verdict

Terratest provides Go helpers for testing infrastructure code, from running tools to checking and removing deployed resources. Note the Go requirement, resource-cleanup advice, and security-fixes-only maintenance for v1.

Plans and prices

From Terratest's own pricing page, checked 3 Oct 2026.

All about pricing
PlanPriceWhat it gives you
Apache 2.0 open-source licenseFreeGo 1.26 or later · infrastructure testing library

The facts

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

What it does

Cloud integrations
Its helpers include working with AWS, Azure, and GCP APIs.checked 3 Oct 2026
Cloud support
The site includes examples for AWS and GCP, and lists Azure support among its examples.checked 2 Oct 2026
Commercial support
Companies relying on Terratest in production can get commercial support directly from Gruntwork.checked 2 Oct 2026
Community support
Users can ask questions in GitHub Discussions and report bugs or request improvements through GitHub Issues.checked 2 Oct 2026
Infrastructure tools
Terratest provides helpers for Terraform and OpenTofu, Packer, Docker, Kubernetes, and Helm.checked 3 Oct 2026
Intended users
Terratest is for teams testing infrastructure code, including code built with Terraform, Packer, Docker, and Kubernetes.checked 3 Oct 2026
License
The Terratest code is released under the Apache 2.0 License.checked 3 Oct 2026
Open source
Terratest is an open source project, and its code is released under the Apache 2.0 License.checked 2 Oct 2026
Other helpers
The library includes helpers for SSH commands, HTTP requests, and shell commands.checked 3 Oct 2026
Purpose
Terratest is a Go library with patterns and helper functions for testing infrastructure code.checked 2 Oct 2026
Requirements
Terratest requires Go 1.26 or later; its Terraform helpers can use either the Terraform or OpenTofu binary.checked 3 Oct 2026
Resource cleanup
The documentation recommends cleaning up after tests because Terratest can deploy real resources into real environments.checked 2 Oct 2026
Support
Users can ask general questions in GitHub Discussions, report bugs or request improvements through GitHub Issues, and obtain commercial support from Gruntwork.checked 3 Oct 2026
Supported tools
The site lists first-class support for Terraform, Packer, Docker, Kubernetes, AWS, GCP, and more.checked 2 Oct 2026
Testing workflow
Tests can deploy real infrastructure, validate it with HTTP requests, API calls, or SSH connections, and undeploy it at the end.checked 3 Oct 2026
Test types
The documentation covers unit, integration, and end-to-end testing, as well as parallelism, retries, error handling, and static analysis.checked 2 Oct 2026
Test workflow
Terratest tests use Go’s testing framework to run infrastructure tools, validate deployed infrastructure, and undeploy it at the end.checked 2 Oct 2026
Validation
Built-in tools can validate infrastructure by making HTTP requests, API calls, and SSH connections.checked 2 Oct 2026
Version maintenance
The v1 line receives security fixes only while v2 is in development.checked 3 Oct 2026
What it does
Terratest is a Go library for writing automated tests for infrastructure code.checked 3 Oct 2026

The company

Founded
2016checked 23 Sep 2026
Maker
The site identifies Terratest as built by Gruntwork.checked 2 Oct 2026
Maker founding
Gruntwork says the two companies that became Gruntwork merged in 2016.checked 2 Oct 2026
The full review of Terratest

Terratest is an open-source Go library for writing automated tests for infrastructure code. It suits teams that need to exercise Terraform, Kubernetes, cloud, and related infrastructure workflows; its central trade-off is the Go requirement and the care needed when tests create real resources.

Overview

Rather than replace an infrastructure tool, Terratest gives Go tests helpers for running tools, checking what they deploy, and tearing it down. That makes it a practical fit for teams that want infrastructure checks in an automated test workflow, not just static review. The project is Apache 2.0 licensed, with general questions handled through GitHub Discussions and bug reports or improvement requests through GitHub Issues.

Key features

Tests use Go’s testing framework and can run infrastructure tools, validate deployed infrastructure, then undeploy it. Built-in checks make HTTP requests, call APIs, or connect over SSH; helpers also cover shell commands. This supports checks against running environments, but because deployments can create real resources, cleanup belongs in the test plan rather than as an afterthought.

Terratest provides helpers for Terraform and OpenTofu, Terragrunt, Packer, Docker, Kubernetes, and Helm, along with AWS, Azure, and GCP APIs. Its documentation covers unit, integration, and end-to-end approaches, as well as parallel tests, retries, error handling, and static analysis. The breadth is useful for teams spanning several infrastructure tools; the Go-based framework is less suitable for teams seeking a standalone, language-neutral testing interface.

The quick start requires Go 1.26 or later and OpenTofu or Terraform for its examples. The execution model is local, and the feature set includes provisioning tests, deployed checks, configuration compliance, and policy as code.

Pricing

Terratest is free and open source. The Apache 2.0 open-source license plan costs nothing and requires Go 1.26 or later; it is the natural choice for teams able to work within that toolchain. There are no cheaper tiers with reduced capabilities. Companies relying on Terratest in production can obtain commercial support directly from Gruntwork.

Platforms

Terratest supports Linux. Its local execution model and Go requirement make it a fit for Linux-based development and test environments; no broader platform recommendation follows from that support.

Who it's for

Terratest is best for engineering teams that already use Go and want repeatable tests around infrastructure code, including deployments that need API, HTTP, or SSH validation. Teams should account for real-resource cleanup, and should look elsewhere if they need a non-Go workflow or a broader platform target than Linux.

Pros and cons

  • Pros: One Go test workflow can run infrastructure tools, inspect deployed resources, and tear them down, making it useful for integration and end-to-end checks.
  • Pros: Helpers span major IaC tools, cloud APIs, and HTTP, SSH, and shell checks, supporting varied infrastructure stacks.
  • Pros: Apache 2.0 licensing makes the library free to use, with commercial support available from Gruntwork for production reliance.
  • Cons: Go 1.26 or later is required by the quick start, which rules out teams unwilling to adopt that language and version.
  • Cons: Tests may provision real infrastructure, so teams must implement cleanup to avoid leaving resources behind.
  • Cons: The v1 line receives security fixes only while v2 is in development, a maintenance constraint for teams choosing that line.

Alternatives

Infrastructure Testing Tools is the broader category for comparing options. Choose Test Kitchen if cross-platform support across Linux, macOS, and Windows matters more than Terratest’s Go-based workflow. Checkov is another free, open-source CLI option, with Linux and macOS support.

Chef InSpec may suit readers looking for a free non-production option for personal, non-commercial use, or a 30-day trial. KICS is a free open-source project for readers comparing another infrastructure policy-as-code tool. AWS CloudFormation is worth considering for AWS-focused infrastructure work; CloudFormation itself is free, while underlying AWS resources are billed at their own rates.

Cinc Auditor is a free distribution of Chef InSpec, without formal warranties or support. Conftest is another Apache 2.0 open-source option. Sonobuoy is an open-source alternative.

Verdict

Choose Terratest if your team uses Go and needs to test infrastructure by running tools, checking real deployments, and cleaning them up in one workflow. Its breadth and free Apache 2.0 license are compelling; the Go version requirement, resource-cleanup burden, Linux support, and security-fixes-only v1 maintenance are sound reasons to look elsewhere.

Alternatives to Terratest

All alternatives
  1. 1

    Chef InSpec

    Free planOpen sourceAPILinuxmacOSSelf-hosted
    8.0From $59 a year
  2. 2AWS CloudFormation logo

    AWS CloudFormation

    Free planiOSWebAPILinux
    7.7Free plan
  3. 3CIS-CAT Pro Assessor logo

    CIS-CAT Pro Assessor

    Free planAPILinuxmacOSSelf-hosted
    7.7From $2,400 a year
  4. 4

    Test Kitchen

    Free planOpen sourceAPILinuxmacOSSelf-hosted
    7.2Free plan
  5. 5

    kube-score

    Free planWebLinuxmacOSSelf-hosted
    7.0Free plan
  6. 6

    Conftest

    Free planLinuxmacOSWindows
    6.8Free plan