Sunday, October 25, 2026 4,350 lists 78,096 records on file
List your app or device

  1. Home
  2. Infrastructure Testing Tools
  3. terraform-plugin-testing

terraform-plugin-testing

What it is

terraform-plugin-testing is a free Go helper module for testing Terraform providers. Developers can write isolated unit tests without network connections, as well as acceptance tests that run real Terraform plan, apply, refresh, and destroy operations and let them assert the results. Acceptance testing includes Lifecycle, Import, Refresh, and Query modes. The plancheck package checks empty or non-empty plans, plus resource and data source values and actions. The statecheck package covers known and sensitive values and comparisons between resource or data source attributes. The module uses a local Terraform binary and standard Go testing tools, including go test. Acceptance tests can run in environments that support go test, including continuous integration runners such as GitHub Actions. Because those tests can create and destroy real infrastructure, they may consume quotas and incur expenses. 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. The repository says it supports the two latest major Go releases and currently requires Go 1.25 or later as a dependency. It is licensed under Mozilla Public License v2.0.

For and against

For

  • Free Go module for Terraform provider testing.
  • Unit tests can run without network connections.
  • Supports several acceptance-test modes.
  • Includes plan and state checks.
  • Acceptance tests can run in CI.

Against

  • Acceptance tests may incur infrastructure expenses.
  • Tests can consume infrastructure quotas.
  • Acceptance tests require Terraform CLI 0.12.26 or later.
  • Acceptance tests require Go 1.25 or later currently.

The verdict

terraform-plugin-testing offers unit and real-operation acceptance tests, with checks for plans and state. Account for its prerequisites and the possible infrastructure costs and quota use of acceptance tests.

Who it suits

This module is for Go developers testing Terraform providers with unit or acceptance tests. It may suit teams that want provider checks in a local or CI environment and can meet the acceptance-test prerequisites.

Plans and prices

Open source

Free

Terraform provider testing Go module

Every plan, in full

On the record

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 · read 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 · read 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 · read 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 · read 3 Oct 2026
Infrastructure costs
Acceptance tests can create and destroy real infrastructure, which may incur expenses and consume quotas.developer.hashicorp.com · read 3 Oct 2026
License
The project is licensed under Mozilla Public License v2.0.github.com · read 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 · read 3 Oct 2026
Purpose
terraform-plugin-testing is a Go helper module for testing Terraform providers.github.com · read 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 · read 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 · read 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 · read 3 Oct 2026
Test modes
Acceptance tests support Lifecycle, Import, Refresh, and Query modes.developer.hashicorp.com · read 3 Oct 2026
Unit tests
Unit tests can test plugin code in isolated units without network connections.developer.hashicorp.com · read 3 Oct 2026

Alternatives to terraform-plugin-testing

Every alternative, ranked