No description
Find a file
Service Account - Terraform Provider DevEx a876e74c02 [CI] terraform-devex-repos automation
2025-12-15 21:54:25 +01:00
.changes Update changelog 2024-09-09 18:44:01 +00:00
.github [CI] terraform-devex-repos automation 2025-12-15 21:54:25 +01:00
code spec: Convert code imports from string to object with optional alias property (#32) 2023-06-23 15:33:14 -04:00
datasource Replace tenv and exportloopref linters with usetesting and copyloopvar (#130) 2025-02-26 18:07:53 -05:00
META.d Add catalog metadata (META.d) (#138) 2025-05-13 08:18:54 -04:00
provider Replace tenv and exportloopref linters with usetesting and copyloopvar (#130) 2025-02-26 18:07:53 -05:00
resource Replace tenv and exportloopref linters with usetesting and copyloopvar (#130) 2025-02-26 18:07:53 -05:00
schema Replace tenv and exportloopref linters with usetesting and copyloopvar (#130) 2025-02-26 18:07:53 -05:00
spec Replace tenv and exportloopref linters with usetesting and copyloopvar (#130) 2025-02-26 18:07:53 -05:00
tools build(deps): bump golang.org/x/net from 0.33.0 to 0.36.0 in /tools (#132) 2025-03-24 11:42:49 -04:00
.changie.yaml [CI] terraform-devex-repos automation 2024-06-07 16:22:48 -04:00
.copywrite.hcl Add catalog metadata (META.d) (#138) 2025-05-13 08:18:54 -04:00
.gitignore Add release workflow and changie (#57) 2023-10-10 15:31:12 -04:00
.golangci.yml Replace tenv and exportloopref linters with usetesting and copyloopvar (#130) 2025-02-26 18:07:53 -05:00
.goreleaser.yml SEC-090: Automated trusted workflow pinning (2024-06-17) (#103) 2024-06-21 11:22:38 -04:00
CHANGELOG.md Update changelog 2024-09-09 18:44:01 +00:00
go.mod build(deps): bump github.com/google/go-cmp from 0.6.0 to 0.7.0 (#128) 2025-02-24 11:11:41 -05:00
go.sum build(deps): bump github.com/google/go-cmp from 0.6.0 to 0.7.0 (#128) 2025-02-24 11:11:41 -05:00
LICENSE [COMPLIANCE] Add copyright and license headers (#15) 2023-06-05 09:58:41 -04:00
Makefile [COMPLIANCE] Add copyright and license headers (#15) 2023-06-05 09:58:41 -04:00
README.md Added feedback links (#69) 2023-11-27 08:12:29 -05:00

Terraform Provider Code Specification

Terraform Provider Code Generation is currently in tech preview. If you have general questions or feedback about provider code generation, please create a new topic in the Plugin Development Community Forum.

Overview

The Terraform Provider Code Specification is a versioned interface which is defined with a JSON schema, and has associated Go language bindings. The specification defines a Terraform Provider representation which can be used for the generation of Go code for use in a provider, for example, with the Plugin Framework Code Generator.

A specification can be generated from a declarative API model, such as OpenAPI with the OpenAPI Provider Spec Generator.

Documentation

Full details of each of the fields defined within the JSON schema are available on the HashiCorp Developer site: https://developer.hashicorp.com//terraform/plugin/code-generation/specification.

Versioning

Schema

Schema versioning (e.g., 0.1) follows the convention of using a MAJOR.MINOR version, similar to the versioning used by OpenAPI Specification for example.

Tags & Releases

Tags and releases follow the convention of semantic versioning adhering to MAJOR.MINOR.PATCH versions.

Usage

A JSON schema (e.g., 0.1) defines the structure of a specification implementation by provider developers. For example:

{
  "$id": "https://github.com/hashicorp/terraform-plugin-codegen-spec/spec/v0.1/schema.json",
  "$schema": "https://json-schema.org/draft-07/schema",
  "type": "object",
  "properties": {
    "datasources": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/datasource"
      }
    },
    "provider": {
      "$ref": "#/$defs/provider"
    },
    "resources": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/resource"
      }
    },
    "version": {
      "type": "string",
      "minLength": 3
    }
  },
  "required": [
    "provider",
    "version"
  ],
  ...
}

A corresponding specification implementation (e.g., example.json) could look as follows:

{
  "datasources": [
    { 
      ...
    }
  ],
  "provider": {
    ...
  },
  "resources": [
    {
      ...
    }
  ]
}

Refer to example.json for an example specification.

License

Refer to Mozilla Public License v2.0.

Experimental Status

By using the software in this repository (the "Software"), you acknowledge that: (1) the Software is still in development, may change, and has not been released as a commercial product by HashiCorp and is not currently supported in any way by HashiCorp; (2) the Software is provided on an "as-is" basis, and may include bugs, errors, or other issues; (3) the Software is NOT INTENDED FOR PRODUCTION USE, use of the Software may result in unexpected results, loss of data, or other unexpected results, and HashiCorp disclaims any and all liability resulting from use of the Software; and (4) HashiCorp reserves all rights to make all decisions about the features, functionality and commercial release (or non-release) of the Software, at any time and without any obligation or liability whatsoever.