terraform-provider

Build and publish Terraform providers using the Plugin Framework in Go.

Updated Sep 9, 2026
One-click install
npx skills add https://github.com/DeepSpaceCartel/skills --skill terraform-provider-deepspacecartel
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: terraform-provider
Source: https://github.com/DeepSpaceCartel/skills/tree/main/skills/terraform-provider
Command: npx skills add https://github.com/DeepSpaceCartel/skills --skill terraform-provider-deepspacecartel

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Writing a Terraform provider involves many moving parts — provider server setup, schema design, CRUD lifecycle, drift detection, acceptance testing, and Registry publishing — and getting any of them wrong leads to broken plans, lost state, or rejected releases. This Skill provides the conventions and patterns for doing it correctly with the modern Plugin Framework. ## Core Features & Use Cases - Provider & Schema Design: Structure the provider server, resources, and data sources with correct Required/Optional/Computed attributes, validators, and plan modifiers like UseStateForUnknown and RequiresReplace. - CRUD, State & Drift Detection: Implement Create/Read/Update/Delete with diagnostics, ImportState support, and proper RemoveResource handling so Terraform detects drift when remote objects disappear. - Testing & Publishing: Write TF_ACC-gated acceptance tests with terraform-plugin-testing, generate docs with tfplugindocs, and release via GoReleaser with GPG signing and terraform-registry-manifest.json. - Use Case: You need to add a new resource to your organization's Terraform provider. Use this Skill to scaffold the resource schema, implement CRUD against your API client, add an import test step, and wire the release pipeline for the Terraform Registry. ## Quick Start Use the terraform-provider skill to scaffold a new resource with schema, CRUD methods, and an acceptance test for my provider.

Frequently Asked Questions about terraform-provider

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

FAQPage Schema
How do I write a Terraform provider with the Plugin Framework?▼

Serve a provider via providerserver.Serve with an address like registry.terraform.io/<namespace>/<type>, then implement a provider.Provider with Schema, Resources, DataSources, and Configure. Each resource implements Create, Read, Update, Delete against your API client.

Should I use the Plugin Framework or SDKv2 for a new Terraform provider?▼

Use the Plugin Framework for new providers; it supersedes SDKv2 and is the modern approach documented by HashiCorp. SDKv2 should only be maintained for existing legacy providers, not new development.

How does Terraform detect drift in a custom provider?▼

Drift detection happens in the resource's Read method: when the remote object no longer exists, call resp.State.RemoveResource(ctx). Without this, Terraform believes the resource still exists and will not plan a recreation.

How do I run Terraform provider acceptance tests?▼

Use terraform-plugin-testing's resource.Test with TestSteps containing HCL configs and checks like TestCheckResourceAttr. Tests skip unless TF_ACC=1 is set, keeping plain go test runs offline while CI runs acceptance tests with real credentials.

How do I publish a Terraform provider to the Registry?▼

Release with GoReleaser producing cross-compiled zips, SHA256 checksums, and GPG signatures, plus a terraform-registry-manifest.json declaring protocol versions. The Registry requires a repo named terraform-provider-<type> and a one-time GitHub App linking to your namespace.

Why does my Terraform plan show (known after apply) on every run?▼

This happens when a computed attribute lacks a plan modifier. Add stringplanmodifier.UseStateForUnknown() to computed values like ids so Terraform carries the prior state forward instead of showing a new unknown value each plan.