Back to Skills

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.

668stars77forksUpdated 6/16/2026

Security Assessment

Safe(100/100)
Security Score100/100

About provider-resources

This skill provides comprehensive guidance for implementing Terraform Provider resources and data sources using the Terraform Plugin Framework. It addresses the challenge of developing reliable infrastructure-as-code providers by offering structured patterns for CRUD operations, schema design, state management, and acceptance testing. The skill focuses on the technical implementation details needed to build production-ready Terraform providers that manage cloud infrastructure resources.

The main capabilities include implementing both SDKv2 and Plugin Framework resource patterns, designing robust schemas with proper validation and plan modifiers, managing resource state and lifecycle operations, and structuring provider code according to established conventions. It covers the complete resource development workflow from file organization to CRUD operation implementation, including proper error handling, tagging support, and import functionality.

This skill is specifically designed for platform engineers, infrastructure developers, and DevOps engineers who are building custom Terraform providers or extending existing ones. It's particularly valuable when developing resources for proprietary APIs, internal services, or specialized infrastructure components that need to integrate with Terraform's declarative workflow. The skill is essential for teams implementing infrastructure automation at scale and maintaining consistency across provider implementations.

FAQ

What is the difference between SDKv2 and Plugin Framework patterns?

SDKv2 is the older Terraform provider development framework, while Plugin Framework is the newer, more type-safe approach. The Plugin Framework uses Go generics and provides better compile-time checking, cleaner schema definitions, and improved plan modifiers. New resources should use the Plugin Framework pattern.

When should I implement a data source versus a resource?

Implement a resource when you need to manage the lifecycle (create, update, delete) of an infrastructure object. Implement a data source when you only need to read existing infrastructure state without managing it. Data sources are read-only and are used to reference existing resources or fetch information.

What are the key components of CRUD operations in Terraform resources?

CRUD operations include Create (provision new resources), Read (refresh state from actual infrastructure), Update (modify existing resources), and Delete (destroy resources). Each operation must handle API interactions, state management, error handling, and ensure idempotency. The Read operation is particularly important as Terraform calls it frequently to detect drift.

How do I handle resource state management and imports?

State management involves correctly storing resource attributes in Terraform state after each operation. For imports, implement the Importer field with appropriate state context handling. The resource ID must be parseable to fetch the actual resource state, and the Read operation must populate all required attributes from the API response.

What file structure should I follow for provider resources?

Resources should be organized within internal/service/<service>/ directories, with separate files for the resource implementation, acceptance tests, data sources, and finder functions. Documentation belongs in website/docs/r/ for resources and website/docs/d/ for data sources. The service_package_gen.go file handles auto-generated registration.

Install provider-resources

Download and extract the skill files to your .claude/skills/ directory.

Quick Setup:

  1. Copy the skill folder to .claude/skills/
  2. Claude will automatically detect and use the skill