Freedom251 › Infrastructure Testing Tools
terraform-plugin-testing

What terraform-plugin-testing is
terraform-plugin-testing is a free Go helper module for testing Terraform providers on Linux and macOS. Unit tests exercise plugin code in isolation without network connections. Acceptance tests run actual Terraform plan, apply, refresh, and destroy operations, allowing developers to assert results in Lifecycle, Import, Refresh, and Query modes. The plancheck package checks empty or non-empty plans and resource or data-source values and actions. The statecheck package checks known and sensitive values and compares resource or data-source attributes. The framework uses a local Terraform binary with standard Go testing tools such as go test and the testing package. Acceptance tests can run in continuous-integration environments, including GitHub Actions. They may create and destroy real infrastructure, consuming quotas and incurring expenses. Requirements include a recent stable Go version, Terraform CLI 0.12.26 or later, provider and resource access, and TF_ACC set.
Who it suits
It suits developers building Terraform providers who need unit and acceptance testing in local or CI environments.
What it does well
- Free Go module with no paid plan
- Supports isolated unit tests without network access
- Runs real Terraform lifecycle acceptance tests
- Plan and state assertion packages included
- Works in CI environments running go test
What to know first
- Acceptance tests can incur infrastructure costs
- Requires Terraform CLI 0.12.26 or later
- Requires TF_ACC and provider resource access
- Linux and macOS platforms listed
Limits
Acceptance testing requires Terraform CLI 0.12.26 or later, a recent stable Go version, access to the provider and tested resources, and TF_ACC set to a value. Acceptance tests can create and destroy infrastructure, potentially consuming quotas and incurring expenses.
Plans
| Plan | Billed and limits | Price |
|---|---|---|
| Open source | Terraform provider testing Go module | Free |
As github.com lists them, read 3 Oct 2026. The maker's own page has the final word.
Getting started
- Open the project website on GitHub.
- Use a Linux or macOS environment with a recent stable Go version.
- Install Terraform CLI 0.12.26 or later for acceptance testing.
- Provide access to the provider and resources being tested.
- Set TF_ACC to a value before running acceptance tests with go test.
Verdict
terraform-plugin-testing provides focused Go tooling for checking Terraform provider behavior, from isolated units to real infrastructure operations. Its acceptance prerequisites and possible infrastructure charges should be planned for before use.
Questions
How much does terraform-plugin-testing cost?
It is free. The listed Open source plan is free.
Is there a free plan or trial?
It has a free plan and no free trial.
Which platforms are listed?
Linux and macOS.
What does it test?
It provides isolated unit tests and acceptance tests that run real Terraform plan, apply, refresh, and destroy operations.
What are the acceptance test prerequisites?
They require a recent stable Go version, Terraform CLI 0.12.26 or later, access to the provider and tested resources, and TF_ACC set to a value.
What license does the project use?
Mozilla Public License v2.0.
Facts from terraform-plugin-testing's own pages
- Acceptance prerequisites
- Acceptance tests require a recent stable Go version, Terraform CLI 0.12.26 or later, access to the provider and tested resources, and TF_ACC set to a value. · developer.hashicorp.com, 3 Oct 2026
- Acceptance tests
- Acceptance tests run real Terraform plan, apply, refresh, and destroy operations and let developers assert their outcomes. · developer.hashicorp.com, 3 Oct 2026
- CI use
- Acceptance tests can run in any environment capable of running go test, including a continuous integration runner such as GitHub Actions. · developer.hashicorp.com, 3 Oct 2026
- Go compatibility
- The repository states that the two latest major Go releases are supported and currently requires Go 1.25 or later as a dependency. · github.com, 3 Oct 2026
- Infrastructure costs
- Acceptance tests can create and destroy real infrastructure, which may incur expenses and consume quotas. · developer.hashicorp.com, 3 Oct 2026
- License
- The project is licensed under Mozilla Public License v2.0. · github.com, 3 Oct 2026
- Plan checks
- The plancheck package includes checks for empty or non-empty plans and for resource or data source values and actions. · developer.hashicorp.com, 3 Oct 2026
- Purpose
- terraform-plugin-testing is a Go helper module for testing Terraform providers. · github.com, 3 Oct 2026
- Security reporting
- The repository asks vulnerability reporters to email [email protected] and include reproduction steps, relevant tools and versions, and tool output. · github.com, 3 Oct 2026
- State checks
- The statecheck package includes checks for known values, sensitive values, and comparisons between resource or data source attributes. · developer.hashicorp.com, 3 Oct 2026
- Terraform integration
- The framework uses a local Terraform binary and standard Go testing features including go test and the testing package. · developer.hashicorp.com, 3 Oct 2026
- Test modes
- Acceptance tests support Lifecycle, Import, Refresh, and Query modes. · developer.hashicorp.com, 3 Oct 2026
- Unit tests
- Unit tests can test plugin code in isolated units without network connections. · developer.hashicorp.com, 3 Oct 2026
Where terraform-plugin-testing stands on Freedom251
- Infrastructure Testing Tools#21 of 28