generate-terraform-provider

Generate a Terraform provider from an OpenAPI spec using the Speakeasy CLI.

19|6|Updated Jan 23, 2026
One-click install
npx skills add https://github.com/speakeasy-api/skills --skill generate-terraform-provider
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: generate-terraform-provider
Source: https://github.com/speakeasy-api/skills/tree/main/skills/generate-terraform-provider
Command: npx skills add https://github.com/speakeasy-api/skills --skill generate-terraform-provider

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill automates turning an OpenAPI specification into a fully functioning Terraform provider using the Speakeasy CLI. It covers entity annotations, CRUD mapping, workflow configuration, and publishing to the Terraform Registry.

Core Features & Use Cases

  • Entity annotations: Tag OpenAPI schemas with x-speakeasy-entity to drive Terraform resource generation.
  • CRUD mapping: Map API operations to Terraform CRUD methods and generate provider code.
  • Workflow configuration: Create and tailor .speakeasy/workflow.yaml for automated builds and releases.
  • Publishing: Prepare artifacts for publishing to the Terraform Registry.
  • Use Case: Convert a comprehensive API spec into a ready-to-use Terraform provider with resources and data sources.

Quick Start

Run the Speakeasy quickstart command to generate a Terraform provider from your OpenAPI spec, replacing the placeholders with your spec path, provider name, and package name.

Frequently Asked Questions about generate-terraform-provider

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

FAQPage Schema
How do I generate a Terraform provider from an OpenAPI spec?

You can generate a Terraform provider by annotating your OpenAPI schemas with x-speakeasy-entity and mapping CRUD operations to Terraform methods using the Speakeasy CLI. This automates provider code creation and outputs the necessary gen.yaml configuration.

What is x-speakeasy-entity and how does it work for Terraform provider generation?

x-speakeasy-entity is an OpenAPI extension used to tag schemas that should become Terraform resources. By adding this annotation to your spec, you drive automated Terraform resource generation and map API operations to CRUD methods.

Can I publish a generated Terraform provider to the Terraform Registry?

Yes, you can prepare generated Terraform provider artifacts for publishing directly to the Terraform Registry. The workflow involves configuring .speakeasy/workflow.yaml to automate builds and releases for your provider package.

What do I need to set up before converting an OpenAPI spec to a Terraform provider?

You need an OpenAPI 3.x specification, a working Speakeasy CLI installation with authentication configured, and a defined target provider name and package. These prerequisites enable the CLI to generate the workflow config and provider code.

How do I map API CRUD operations to Terraform methods in my OpenAPI spec?

Mapping API CRUD operations to Terraform methods involves using the Speakeasy CLI to process your OpenAPI spec. The CLI reads your x-speakeasy-entity annotations and automatically translates API operations into corresponding Terraform CRUD methods within the provider code.

What is the best way to automate Terraform provider builds from an OpenAPI specification?

The best way to automate Terraform provider builds is by creating and tailoring a .speakeasy/workflow.yaml file. This workflow configuration drives automated builds and releases through the Speakeasy CLI, streamlining the path from OpenAPI spec to published provider.