terraform-plugin-testing
terraform-plugin-testing is a free Go module for testing Terraform providers.
What terraform-plugin-testing is
terraform-plugin-testing is a free Go module for testing Terraform providers. It offers isolated unit tests that do not require network connections, as well as acceptance tests that run real Terraform plan, apply, refresh, and destroy operations so developers can check their outcomes. Acceptance tests support Lifecycle, Import, Refresh, and Query modes. The plancheck package checks plan status and resource or data source values and actions; statecheck covers known and sensitive values and attribute comparisons. The framework uses a local Terraform binary with standard Go testing tools such as go test. Acceptance tests can run wherever go test is available, including continuous integration runners, but they may create and destroy real infrastructure, consuming quotas and incurring costs. Acceptance testing requires a recent stable Go version, Terraform CLI 0.12.26 or later, access to the provider and resources under test, and TF_ACC set to a value. The project is licensed under Mozilla Public License v2.0.
Good
- Supports isolated unit tests without network connections.
- Acceptance tests cover several testing modes.
- Plan and state checks cover values and actions.
- Can run in CI environments that support go test.
Watch out
- Acceptance tests may incur infrastructure expenses.
- Acceptance testing requires Terraform CLI 0.12.26 or later.
- Acceptance testing requires TF_ACC to be set.
Who it suits
This module is for Go developers building or maintaining Terraform providers who need unit or acceptance tests. It also suits teams running provider tests in CI, provided they account for infrastructure usage.
Verdict
terraform-plugin-testing provides provider-focused unit and acceptance testing within Go's standard testing workflow. Real infrastructure tests can be useful, but they require setup and may use quotas or incur costs.
Plans and prices
From terraform-plugin-testing's own pricing page, checked 3 Oct 2026.
| Plan | Price | What it gives you |
|---|---|---|
| Open source | Free | Terraform provider testing Go module |
The facts
Each one read from terraform-plugin-testing's own pages, with the date it was checked.
What it does
- 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.checked 3 Oct 2026
- Acceptance tests
- Acceptance tests run real Terraform plan, apply, refresh, and destroy operations and let developers assert their outcomes.checked 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.checked 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.checked 3 Oct 2026
- License
- The project is licensed under Mozilla Public License v2.0.checked 3 Oct 2026
- Purpose
- terraform-plugin-testing is a Go helper module for testing Terraform providers.checked 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.checked 3 Oct 2026
- State checks
- The statecheck package includes checks for known values, sensitive values, and comparisons between resource or data source attributes.checked 3 Oct 2026
- Terraform integration
- The framework uses a local Terraform binary and standard Go testing features including go test and the testing package.checked 3 Oct 2026
- Test modes
- Acceptance tests support Lifecycle, Import, Refresh, and Query modes.checked 3 Oct 2026
- Unit tests
- Unit tests can test plugin code in isolated units without network connections.checked 3 Oct 2026
Money
- Infrastructure costs
- Acceptance tests can create and destroy real infrastructure, which may incur expenses and consume quotas.checked 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.checked 3 Oct 2026
Alternatives to terraform-plugin-testing
- 1
Chef InSpec
Free planOpen sourceAPILinuxmacOSSelf-hosted8.0From $59 a year - 2

AWS CloudFormation
Free planiOSWebAPILinux7.7Free plan - 3

CIS-CAT Pro Assessor
Free planAPILinuxmacOSSelf-hosted7.7From $2,400 a year - 4
Test Kitchen
Free planOpen sourceAPILinuxmacOSSelf-hosted7.2Free plan - 5
kube-score
Free planWebLinuxmacOSSelf-hosted7.0Free plan - 6
Conftest
Free planLinuxmacOSWindows6.8Free plan
