New Terraform Provider
HashiCorpOfficialPublished by HashiCorp
- Skill
- Workflow
- Cloud and DevOps
- MPL-2.0
- Low risk
- Has scripts
AutoGineer summary
Written by AutoGineer from the skill’s own files, not by the author
This skill provides a standardized workflow for initializing a new Terraform provider project. It handles the creation of the workspace directory, Go module initialization, and the generation of essential boilerplate files including main.go and the provider configuration. It is designed to help developers quickly set up the foundation for building custom providers for new APIs using the modern Plugin Framework.
What it does
- Creates a new workspace directory with the required naming convention.
- Initializes a Go module for the provider project.
- Downloads the necessary Terraform Plugin Framework dependencies.
- Generates a main.go file for the provider server.
- Creates a provider.go file with initial schema and configuration logic.
- Performs initial validation by running build and test commands.
When to use it
- When starting a new Terraform provider project from scratch.
- When you need to integrate a new API into the Terraform ecosystem.
- When you want to ensure your provider follows standard Plugin Framework project structure.
Advantages
- Ensures consistent project structure across different provider developments.
- Automates the repetitive setup tasks for Go modules and file scaffolding.
- Provides a clean starting point that is ready for immediate development and testing.
Usage examples
- “I need to start building a new Terraform provider for the Acme API. How do I begin?”
- The agent will create a new directory named terraform-provider-acme, initialize the Go module, and generate the necessary boilerplate files to start development.
- “Scaffold a new Terraform provider project for my internal service.”
- The agent will set up the workspace, configure the main.go and provider.go files, and run the initial build and test commands to verify the setup.
Install
Download the skill as a ZIP:
https://autogineer.com/agent-skills/hashicorp/new-terraform-provider/downloadUnzip it into the cross-client skills folder of your project:
mkdir -p .agents/skills && unzip new-terraform-provider.zip -d .agents/skills
Documentation by HashiCorp
To scaffold a new Terraform provider with Plugin Framework:
If I am already in a Terraform provider workspace, then confirm that I want to create a new workspace. If I do not want to create a new workspace, then skip all remaining steps.
Create a new workspace root directory. The root directory name should be prefixed with "terraform-provider-". Perform all subsequent steps in this new workspace.
Initialize a new Go module.
Run
go get -u github.com/hashicorp/terraform-plugin-framework@latest.Write a main.go file that follows the example.
Write an
internal/provider/provider.gofile that follows the example. Rename thedemoprovider, theDEMO_*environment variables, and the authentication attributes to match the target API.Remove TODO comments from
main.goandprovider.go.Run
go mod tidyRun
go build -o /dev/nullRun
go test ./...The scaffold resolves credentials as explicit config with environment variable fallback. To grow that into a full credential provider chain (shared credentials files, profiles, platform identity, configure-time validation), use theprovider-configurationskill (if available). To add the first resource or data source, use theprovider-resourcesskill (if available).
Files
- ATTRIBUTION.mdAdded by AutoGineer877 B
- LICENSELicence file added by AutoGineer16.3 KiB
- SKILL.md1.8 KiB
- assets/main.goScript1.1 KiB
- assets/provider.goScript4.3 KiB
SKILL.md
To scaffold a new Terraform provider with Plugin Framework:
If I am already in a Terraform provider workspace, then confirm that I want to create a new workspace. If I do not want to create a new workspace, then skip all remaining steps.
Create a new workspace root directory. The root directory name should be prefixed with "terraform-provider-". Perform all subsequent steps in this new workspace.
Initialize a new Go module.
Run
go get -u github.com/hashicorp/terraform-plugin-framework@latest.Write a main.go file that follows the example.
Write an
internal/provider/provider.gofile that follows the example. Rename thedemoprovider, theDEMO_*environment variables, and the authentication attributes to match the target API.Remove TODO comments from
main.goandprovider.go.Run
go mod tidyRun
go build -o /dev/nullRun
go test ./...The scaffold resolves credentials as explicit config with environment variable fallback. To grow that into a full credential provider chain (shared credentials files, profiles, platform identity, configure-time validation), use theprovider-configurationskill (if available). To add the first resource or data source, use theprovider-resourcesskill (if available).
Requirements and compatibility
Works with: Claude Code, Claude apps, OpenAI Codex, GitHub Copilot, Cursor, Gemini CLI, Kiro, OpenCode, Goose, Amp, Roo Code, JetBrains Junie, Factory Droid, Devin (ex-Windsurf), Mistral Vibe, OpenHands, Letta
“Works with” means the tool reads the open Agent Skills format; a skill written for one tool may use features others lack.
Security
What our scanner noticed· Low risk
- Scripts that your agent may run
This skill includes scripts that your agent may run. Read them before you use it.
A static scan is not a guarantee. Skills are third-party content: review a skill before you let an agent use it.
Attribution and licence
- Published by
- HashiCorp
- Publisher
- HashiCorp (Official)
- Source
- hashicorp/agent-skills · plugins/terraform/skills/new-terraform-provider · commit 5e30fa5
- Licence
- Mozilla Public License 2.0 (redistribution allowed)
- LICENSE (added by AutoGineer from LICENSE)
- ATTRIBUTION.md (written by AutoGineer)
- Synced
AutoGineer is not affiliated with or endorsed by HashiCorp or HashiCorp.
Download ZIP
The ZIP holds the skill’s files, its licence files and an ATTRIBUTION.md. Download new-terraform-provider.zip