tf-resource-generator

Generate Terraform resources and data sources from OpenAPI specs and YAML definitions.

132|78|Updated Feb 23, 2017
One-click install
npx skills add https://github.com/aiven/terraform-provider-aiven --skill tf-resource-generator
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: tf-resource-generator
Source: https://github.com/aiven/terraform-provider-aiven/tree/main/tools/agents/skills/tf-resource-generator
Command: npx skills add https://github.com/aiven/terraform-provider-aiven --skill tf-resource-generator

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Generate Terraform resources and data sources by learning from existing patterns in the codebase.

Core Features & Use Cases

  • Learns from OpenAPI specs (openapi.json) and YAML definitions (definitions/*.yml) to automate resource creation.
  • Outputs generated code like zz_resource.go, zz_datasource.go, zz_converter.go, and docs/resources/*.md.
  • Supports the Plugin Framework generator and migrations from SDK resources.

Quick Start

Run the generator to produce Terraform resources and data sources from your OpenAPI spec and YAML definitions.

Frequently Asked Questions about tf-resource-generator

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

FAQPage Schema
How do I auto-generate Terraform resources from OpenAPI specs?

To auto-generate Terraform resources from OpenAPI specs, you run a generator that learns existing codebase patterns to produce resource files like zz_resource.go and documentation automatically. This automates adding new resources without manual boilerplate.

Can I migrate existing SDK resources to the Terraform Plugin Framework?

Yes, you can migrate existing SDK resources to the Terraform Plugin Framework. The generator reads YAML definitions and OpenAPI specs to automate the migration, outputting generated Go files like zz_datasource.go and zz_converter.go.

What files are produced when generating Terraform data sources from YAML definitions?

Generating Terraform data sources from YAML definitions produces specific Go files including zz_resource.go, zz_datasource.go, zz_converter.go, alongside markdown documentation in the docs/resources directory.

Does the Terraform resource generator require predefined YAML definitions?

Yes, the Terraform resource generator requires YAML definitions located in definitions/*.yml or an openapi.json file. It learns from these specifications to automate code generation for new resources and data sources.

Why use a code generator for Terraform resources instead of writing them manually?

Using a code generator for Terraform resources eliminates manual boilerplate by learning from existing patterns in OpenAPI specs. It ensures consistency across generated Go files and automatically produces required documentation.

When should I not use an automated Terraform resource generator?

You should not use an automated Terraform resource generator if your API lacks an OpenAPI spec or YAML definitions. The tool relies on these structured inputs to learn existing patterns and output generated code accurately.