finds.dev← search

// the find

gruntwork-io/terratest

★ 7,930 · Go · Apache-2.0 · updated Jun 2026

Terratest is a Go library that makes it easier to write automated tests for your infrastructure code.

Terratest is a Go testing library for infrastructure code — Terraform modules, Packer images, Docker containers, Helm charts, and cloud APIs across AWS, Azure, and GCP. It wraps the standard Go testing package with helpers that handle the ugly parts: waiting for resources to become available, SSH-ing into servers, making HTTP assertions, and cleaning up on failure. If you write Terraform modules and want something beyond `terraform validate`, this is the standard answer.

The retry and backoff helpers are genuinely useful — infrastructure doesn't come up instantly and rolling your own polling loop for every test gets old fast. The test stages pattern (`RunTestStage`) lets you skip slow setup phases during iteration, which saves real time when a Terraform apply takes 10 minutes. The v1 migration story is handled well: deprecated symbols stay with annotations and removals wait for v2, so pinned consumers don't get broken by a minor bump. The `terratest_log_parser` CLI is a small but practical tool — interleaved parallel test output is unreadable without something to split it by test name.

Tests are slow by nature and Terratest doesn't help you make them faster — it just makes slowness more survivable. Running a full suite against real cloud infrastructure requires real credentials and real money, and there's no built-in cost estimation or budget guard. The Azure module coverage is noticeably thinner than AWS; some Azure resource types have minimal helper support and you end up writing raw SDK calls anyway. v2 is in development but the timeline isn't published, which makes adopting v1 now a mild gamble on how disruptive the v2 module path change turns out to be in practice.

View on GitHub → Homepage ↗

// want more like this?

We dig through GitHub every week and send a few repos picked for what you actually care about — each with an honest take like this one.

Get finds in your inbox → Search again →