provider-test-patterns

Standardize Terraform provider acceptance tests with Plugin Framework and terraform-plugin-testing.

Updated Jul 20, 2026
One-click install
npx skills add https://github.com/kk0ga/terraform-aws-learning --skill provider-test-patterns-kk0ga
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: provider-test-patterns
Source: https://github.com/kk0ga/terraform-aws-learning/tree/main/.agents/skills/provider-test-patterns
Command: npx skills add https://github.com/kk0ga/terraform-aws-learning --skill provider-test-patterns-kk0ga

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This skill addresses the complexity of writing robust acceptance tests for Terraform providers, ensuring that infrastructure resources are correctly created, updated, and destroyed without drift.

Core Features & Use Cases

  • Modern Assertions: Provides patterns for using ConfigStateChecks and PlanChecks to verify resource state and plan behavior.
  • Lifecycle Management: Includes guidance on CheckDestroy, import testing, and handling ephemeral resources.
  • Use Case: When developing a new Terraform resource, use this skill to structure your acceptance tests to verify that your resource handles updates, deletions, and external state changes correctly.

Quick Start

Use the provider-test-patterns skill to generate a test structure for a new resource that includes state checks and a destroy verification function.

Frequently Asked Questions about provider-test-patterns

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I write Terraform provider acceptance tests for resource lifecycles?

Terraform provider acceptance tests verify infrastructure resources are created, updated, and destroyed without drift. This skill standardizes test suites using the Plugin Framework and terraform-plugin-testing to cover resource lifecycles, import verification, and plan validation.

What is the best way to verify Terraform resource state and plan behavior?

Verifying Terraform resource state and plan behavior uses modern assertions like ConfigStateChecks and PlanChecks. These patterns ensure type-safe state assertions, confirming that your resource handles updates, deletions, and external state changes correctly.

How do I handle infrastructure cleanup in Terraform acceptance testing?

Infrastructure cleanup in Terraform acceptance testing is handled via sweepers. This skill provides patterns to facilitate infrastructure cleanup, ensuring test environments are correctly managed and resources are destroyed after test execution.

Does this skill support Terraform provider import testing and regression testing?

Yes, this skill supports Terraform provider import testing and regression testing. It includes guidance on import verification and CheckDestroy functions, satisfying requirements for regression testing and handling ephemeral resources.

Can I use terraform-plugin-testing with the Plugin Framework for acceptance tests?

Yes, you can use terraform-plugin-testing with the Plugin Framework. This skill standardizes acceptance test implementation using both tools, facilitating the creation of test suites that verify type-safe state assertions and plan validation.

Why do my Terraform provider acceptance tests show infrastructure drift?

Terraform provider acceptance tests show infrastructure drift when resources are not correctly created, updated, and destroyed. This skill addresses this complexity by providing patterns for CheckDestroy and plan validation to prevent drift.