Community생산성 & 협업github.com

hashicorp/provider-test-patterns

Terraform 제공자 수용 테스트 패턴 - Plugin Framework와 terraform-plugin-testing을 사용한 테스트 구조, TestCase/TestStep 필드, ConfigStateChecks, 계획 확인, import 테스트, 스위퍼, 시나리오 패턴, 임시 리소스 테스트를 다룹니다.

provider-test-patterns란 무엇인가요?

이 스킬은 HashiCorp Terraform Provider 개발 시 Plugin Framework와 `terraform-plugin-testing` 라이브러리를 활용한 수용 테스트(Acceptance Test) 패턴을 종합적으로 제공합니다. 개발자는 테스트 파일 구조, `TestCase` 및 `TestStep` 필드 구성법, `ConfigStateChecks`와 커스텀 `statecheck.StateCheck` 구현체를 통한 상태 검증, `plancheck`를 통한 계획 확인, `CompareValue`를 사용한 교차 단계 단언(Cross-step assertion), 설정 헬퍼(Config helper) 함수, `ImportStateKind`를 이용한 가져오기(import) 테스트, 그리고 스위퍼(Sweepers)를 활용한 리소스 정리 방법을 배울 수 있습니다. 또한 기본(Basic), 업데이트(Update), 사라짐(Disappears), 검증(Validation), 회귀(Regression) 등 주요 시나리오별 테스트 패턴과 `echoprovider` 패키지를 이용한 임시 리소스(Ephemeral Resource) 테스트 방법을 제공합니다. 이 스킬은 제공자 테스트 코드를 작성, 리뷰 또는 디버깅할 때 유용하며, `statecheck`, `plancheck`, `TestCheckFunc`, `CheckDestroy`, `ExpectError`, 가져오기 상태 검증, 임시 리소스, 테스트 파일 구조화에 관한 질문에 답하는 데 특화되어 있습니다.

지원 대상~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/hashicorp/agent-skills/tree/main/skills/provider-test-patterns

Installed? Explore more 생산성 & 협업 skills: steipete/gemini, steipete/gh-issues, steipete/skill-creator · View all 6 →

즐겨 사용하는 AI에게 물어보기

이 에이전트 스킬이 미리 로드된 새 채팅을 엽니다.

문서

provider-test-patterns은(는) 무엇을 하나요?

terraform-plugin-testing과 Plugin Framework를 사용한 Terraform 제공자 수용 테스트 패턴입니다. 테스트 구조, TestCase/TestStep 필드, 커스텀 statecheck.StateCheck 구현체를 활용한 ConfigStateChecks, 계획 확인, 교차 단계 단언을 위한 CompareValue, 설정 헬퍼, ImportStateKind를 활용한 가져오기 테스트, 스위퍼, 시나리오 패턴(기본, 업데이트, 사라짐, 검증, 회귀), 그리고 echoprovider 패키지를 사용한 임시 리소스 테스트를 다룹니다. 제공자 수용 테스트를 작성, 검토, 디버깅할 때 유용하며, statecheck, plancheck, TestCheckFunc, CheckDestroy, ExpectError, 가져오기 상태 검증, 임시 리소스, 테스트 파일 구조화에 관한 질문에 사용하세요.

Individual skills in this repo

This repo contains 15 individual skills — each has its own dedicated page.

hashicorp/aws-ami-builder

Build Amazon Machine Images (AMIs) with Packer using the amazon-ebs builder. Use when creating custom AMIs for EC2 instances.

hashicorp/azure-image-builder

Build Azure managed images and Azure Compute Gallery images with Packer. Use when creating custom images for Azure VMs.

hashicorp/azure-verified-modules

Azure Verified Modules (AVM) requirements and best practices for developing certified Azure Terraform modules. Use when creating or reviewing Azure modules that need AVM certification.

hashicorp/new-terraform-provider

Use this when scaffolding a new Terraform provider.

hashicorp/provider-actions

Implement Terraform Provider actions using the Plugin Framework. Use when developing imperative operations that execute at lifecycle events (before/after create, update, destroy).

hashicorp/provider-docs

Create, update, and review Terraform provider documentation for Terraform Registry using HashiCorp-recommended patterns, tfplugindocs templates, and schema descriptions. Use when adding or changing provider configuration, resources, data sources, ephemeral resources, list resources, functions, or guides; when validating generated docs; and when troubleshooting missing or incorrect Registry documentation.

hashicorp/provider-resources

Implement Terraform Provider resources and data sources using the Plugin Framework. Use when developing CRUD operations, schema design, state management, and acceptance testing for provider resources.

hashicorp/push-to-registry

Push Packer build metadata to HCP Packer registry for tracking and managing image lifecycle. Use when integrating Packer builds with HCP Packer for version control and governance.

hashicorp/refactor-module

Transform monolithic Terraform configurations into reusable, maintainable modules following HashiCorp's module design principles and community best practices.

hashicorp/run-acceptance-tests

Guide for running acceptance tests for a Terraform provider. Use this when asked to run an acceptance test or to run a test with the prefix `TestAcc`.

hashicorp/terraform-search-import

Discover existing cloud resources using Terraform Search queries and bulk import them into Terraform management. Use when bringing unmanaged infrastructure under Terraform control, auditing cloud resources, or migrating to IaC.

hashicorp/terraform-stacks

Comprehensive guide for working with HashiCorp Terraform Stacks. Use when creating, modifying, or validating Terraform Stack configurations (.tfcomponent.hcl, .tfdeploy.hcl files), working with stack components and deployments from local modules, public registry, or private registry sources, managing multi-region or multi-environment infrastructure, or troubleshooting Terraform Stacks syntax and structure.

hashicorp/terraform-style-guide

Generate Terraform HCL code following HashiCorp's official style conventions and best practices. Use when writing, reviewing, or generating Terraform configurations.

hashicorp/terraform-test

Comprehensive guide for writing and running Terraform tests. Use when creating test files (.tftest.hcl), writing test scenarios with run blocks, validating infrastructure behavior with assertions, mocking providers and data sources, testing module outputs and resource configurations, or troubleshooting Terraform test syntax and execution.

hashicorp/windows-builder

Build Windows images with Packer using WinRM communicator and PowerShell provisioners. Use when creating Windows AMIs, Azure images, or VMware templates.

관련 스킬