Terraform
Private provider versions and platforms API reference
These endpoints are only relevant to private providers. When you publish a private provider to the HCP Terraform private registry, you must also create at least one version and at least one platform for that version before consumers can use the provider in configurations. Unlike the public Terraform Registry, the private registry does not automatically upload new releases. You must manually add new provider versions and the associated release files.
All members of an organization can view and use both public and private providers, but you need owners team or Manage Private Registry permissions to add, update, or delete provider versions and platforms in private registry.
Create a Provider Version
POST /organizations/:organization_name/registry-providers/:registry_name/:namespace/:name/versions
The private registry does not automatically update private providers when you release new versions. You must use this endpoint to add each new version. Consumers cannot use new versions until you upload all required release files and Create a Provider Platform.
Parameters
Parameter | Description |
---|---|
:organization_name | The name of the organization to create a provider in. The organization must already exist, and the token authenticating the API request must belong to the "owners" team or a member of the "owners" team. |
:registry_name | Must be private . |
:namespace | The namespace of the provider for which the version is being created. For private providers this is the same as the :organization_name parameter. |
:name | The name of the provider for which the version is being created. |
Creates a new registry provider version. This endpoint only applies to private providers.
Status | Response | Reason |
---|---|---|
201 | JSON API document (type: "registry-provider-versions" ) | Success |
422 | JSON API error object | Malformed request body (missing attributes, wrong types, etc.) |
403 | JSON API error object | Forbidden - not available for public providers |
404 | JSON API error object | User not authorized |
Request Body
This POST endpoint requires a JSON object with the following properties as a request payload.
Properties without a default value are required.
Key path | Type | Default | Description |
---|---|---|---|
data.type | string | Must be "registry-provider-versions" . | |
data.attributes.version | string | A valid semver version string. | |
data.attributes.key-id | string | A valid gpg-key string. | |
data.attributes.protocols | array | An array of Terraform provider API versions that this version supports. Must be one or all of the following values ["4.0","5.0","6.0"] . |
Note: Only Terraform 0.13 and later support third-party provider registries, and that Terraform version requires provider API version 5.0 or later. So you do not need to list major versions 4.0 or earlier in the protocols
attribute.
Sample Payload
{
"data": {
"type": "registry-provider-versions",
"attributes": {
"version": "3.1.1",
"key-id": "32966F3FB5AC1129",
"protocols": ["5.0"]
}
}
}
Sample Request
curl \
--header "Authorization: Bearer $TOKEN" \
--header "Content-Type: application/vnd.api+json" \
--request POST \
--data @payload.json \
https://app.terraform.io/api/v2/organizations/hashicorp/registry-providers/private/hashicorp/aws/versions
Sample Response
{
"data": {
"id": "provver-y5KZUsSBRLV9zCtL",
"type": "registry-provider-versions",
"attributes": {
"version": "3.1.1",
"created-at": "2022-02-11T19:16:59.876Z",
"updated-at": "2022-02-11T19:16:59.876Z",
"key-id": "32966F3FB5AC1129",
"protocols": ["5.0"],
"permissions": {
"can-delete": true,
"can-upload-asset": true
},
"shasums-uploaded": false,
"shasums-sig-uploaded": false
},
"relationships": {
"registry-provider": {
"data": {
"id": "prov-cmEmLstBfjNNA9F3",
"type": "registry-providers"
}
},
"platforms": {
"data": [],
"links": {
"related": "/api/v2/organizations/hashicorp/registry-providers/private/hashicorp/aws/versions/3.1.1/platforms"
}
}
},
"links": {
"shasums-upload": "https://archivist.terraform.io/v1/object/dmF1b...",
"shasums-sig-upload": "https://archivist.terraform.io/v1/object/dmF1b..."
}
}
}
Get All Versions for a Single Provider
GET /organizations/:organization_name/registry-providers/:registry_name/:namespace/:name/versions/
Parameters
Parameter | Description |
---|---|
:organization_name | The name of the organization the provider belongs to. |
:registry_name | Must be private . |
:namespace | The namespace of the provider. Must be the same as the organization_name for the provider. |
:name | The provider name. |
Status | Response | Reason |
---|---|---|
200 | JSON API document (type: "registry-providers" ) | Success |
403 | JSON API error object | Forbidden - public provider curation disabled |
404 | JSON API error object | Provider not found or user unauthorized to perform action |
Sample Request
curl \
--request GET \
--header "Authorization: Bearer $TOKEN" \
--header "Content-Type: application/vnd.api+json" \
https://app.terraform.io/api/v2/organizations/hashicorp/registry-providers/private/hashicorp/aws/versions
Sample Response
{
"data": [
{
"id": "provver-y5KZUsSBRLV9zCtL",
"type": "registry-provider-versions",
"attributes": {
"version": "3.1.1",
"created-at": "2022-02-11T19:16:59.876Z",
"updated-at": "2022-02-11T19:16:59.876Z",
"key-id": "32966F3FB5AC1129",
"protocols": ["5.0"],
"permissions": {
"can-delete": true,
"can-upload-asset": true
},
"shasums-uploaded": true,
"shasums-sig-uploaded": true
},
"relationships": {
"registry-provider": {
"data": {
"id": "prov-cmEmLstBfjNNA9F3",
"type": "registry-providers"
}
},
"platforms": {
"data": [
{
"id": "provpltfrm-GSHhNzptr9s3WoLD",
"type": "registry-provider-platforms"
},
{
"id": "provpltfrm-A1PHitiM2KkKpVoM",
"type": "registry-provider-platforms"
},
{
"id": "provpltfrm-BLJWvWyJ2QMs525k",
"type": "registry-provider-platforms"
},
{
"id": "provpltfrm-qQYosUguetYtXGzJ",
"type": "registry-provider-platforms"
},
{
"id": "provpltfrm-pjDHFN46y193bS7t",
"type": "registry-provider-platforms"
}
],
"links": {
"related": "/api/v2/organizations/hashicorp/registry-providers/private/hashicorp/aws/versions/3.1.1/platforms"
}
}
},
"links": {
"shasums-download": "https://archivist.terraform.io/v1/object/dmF1b...",
"shasums-sig-download": "https://archivist.terraform.io/v1/object/dmF1b..."
}
}
],
"links": {
"self": "https://app.terraform.io/api/v2/organizations/hashicorp/registry-providers/private/hashicorp/aws/versions?page%5Bnumber%5D=1&page%5Bsize%5D=20",
"first": "https://app.terraform.io/api/v2/organizations/hashicorp/registry-providers/private/hashicorp/aws/versions?page%5Bnumber%5D=1&page%5Bsize%5D=20",
"prev": null,
"next": null,
"last": "https://app.terraform.io/api/v2/organizations/hashicorp/registry-providers/private/hashicorp/aws/versions?page%5Bnumber%5D=1&page%5Bsize%5D=20"
},
"meta": {
"pagination": {
"current-page": 1,
"page-size": 20,
"prev-page": null,
"next-page": null,
"total-pages": 1,
"total-count": 1
}
}
}
Note: The shasums-uploaded
and shasums-sig-uploaded
properties will be false if those files have not been uploaded to Archivist. In this case, instead of including links to shasums-download
and shasums-sig-download
, the response will include upload links (shasums-upload
and shasums-sig-upload
).
Get a Version
GET /organizations/:organization_name/registry-providers/:registry_name/:namespace/:name/versions/:version
Parameters
Parameter | Description |
---|---|
:organization_name | The name of the organization the provider belongs to. |
:registry_name | Must be private . |
:namespace | The namespace of the provider. Must be the same as the organization_name for the provider. |
:name | The provider name. |
:version | The version of the provider being created to which different platforms can be added. |
Status | Response | Reason |
---|---|---|
200 | JSON API document (type: "registry-providers" ) | Success |
403 | JSON API error object | Forbidden - public provider curation disabled |
404 | JSON API error object | Provider not found or user unauthorized to perform action |
Sample Request
curl \
--request GET \
--header "Authorization: Bearer $TOKEN" \
--header "Content-Type: application/vnd.api+json" \
https://app.terraform.io/api/v2/organizations/hashicorp/registry-providers/private/hashicorp/aws/versions/3.1.1
Sample Response
{
"data": {
"id": "provver-y5KZUsSBRLV9zCtL",
"type": "registry-provider-versions",
"attributes": {
"version": "3.1.1",
"created-at": "2022-02-11T19:16:59.876Z",
"updated-at": "2022-02-11T19:16:59.876Z",
"key-id": "32966F3FB5AC1129",
"protocols": ["5.0"],
"permissions": {
"can-delete": true,
"can-upload-asset": true
},
"shasums-uploaded": true,
"shasums-sig-uploaded": true
},
"relationships": {
"registry-provider": {
"data": {
"id": "prov-cmEmLstBfjNNA9F3",
"type": "registry-providers"
}
},
"platforms": {
"data": [
{
"id": "provpltfrm-GSHhNzptr9s3WoLD",
"type": "registry-provider-platforms"
},
{
"id": "provpltfrm-A1PHitiM2KkKpVoM",
"type": "registry-provider-platforms"
},
{
"id": "provpltfrm-BLJWvWyJ2QMs525k",
"type": "registry-provider-platforms"
},
{
"id": "provpltfrm-qQYosUguetYtXGzJ",
"type": "registry-provider-platforms"
},
{
"id": "provpltfrm-pjDHFN46y193bS7t",
"type": "registry-provider-platforms"
}
],
"links": {
"related": "/api/v2/organizations/hashicorp/registry-providers/private/hashicorp/aws/versions/3.1.1/platforms"
}
}
},
"links": {
"shasums-download": "https://archivist.terraform.io/v1/object/dmF1b...",
"shasums-sig-download": "https://archivist.terraform.io/v1/object/dmF1b..."
}
}
}
Note: shasums-uploaded
and shasums-sig-uploaded
will be false if those files haven't been uploaded to Archivist yet. In this case, instead of including links to shasums-download
and shasums-sig-download
, the response will include upload links (shasums-upload
and shasums-sig-upload
).
Delete a Version
DELETE /organizations/:organization_name/registry-providers/:registry_name/:namespace/:name/versions/:provider_version
Parameters
Parameter | Description |
---|---|
:organization_name | The name of the organization to delete a provider version from. The organization must already exist, and the token authenticating the API request must belong to the "owners" team or a member of the "owners" team. |
:registry_name | Must be private . |
:namespace | The namespace of the provider for which the version is being deleted. For private providers this is the same as the :organization_name parameter. |
:name | The name of the provider for which the version is being deleted. |
:version | The version for the provider that will be deleted along with its corresponding platforms. |
Status | Response | Reason |
---|---|---|
204 | No Content | Success |
403 | JSON API error object | Forbidden - public provider curation disabled |
404 | JSON API error object | Provider not found or user not authorized to perform action |
Sample Request
curl \
--header "Authorization: Bearer $TOKEN" \
--header "Content-Type: application/vnd.api+json" \
--request DELETE \
https://app.terraform.io/api/v2/organizations/hashicorp/registry-providers/public/hashicorp/aws/versions/3.1.1
Create a Provider Platform
POST /organizations/:organization_name/registry-providers/:registry_name/:namespace/:name/versions/:version/platforms
Platforms are binaries that allow the provider to run on a particular operating system and architecture combination (e.g., Linux and AMD64). GoReleaser creates binaries automatically when you create a release on GitHub or create a release locally.
You must upload one or more platforms for each version of a private provider. After you create a platform, you must upload the platform binary file to the provider-binary-upload
URL.
Parameters
Parameter | Description |
---|---|
:organization_name | The name of the organization to create a provider platform in. The organization must already exist, and the token authenticating the API request must belong to the "owners" team or a member of the "owners" team. |
:registry_name | Must be private . |
:namespace | The namespace of the provider for which the platform is being created. For private providers this is the same as the :organization_name parameter. |
:name | The name of the provider for which the platform is being created. |
:version | The provider version of the provider for which the platform is being created. |
Creates a new registry provider platform. This endpoint only applies to private providers.
Status | Response | Reason |
---|---|---|
201 | JSON API document (type: "registry-provider-platforms" ) | Success |
422 | JSON API error object | Malformed request body (missing attributes, wrong types, etc.) |
403 | JSON API error object | Forbidden - not available for public providers |
404 | JSON API error object | User not authorized |
Request Body
This POST endpoint requires a JSON object with the following properties as a request payload.
Properties without a default value are required.
Key path | Type | Default | Description |
---|---|---|---|
data.type | string | Must be "registry-provider-platforms" . | |
data.attributes.os | string | A valid operating system string. | |
data.attributes.arch | string | A valid architecture string. | |
data.attributes.shasum | string | A valid shasum string. | |
data.attributes.filename | string | A valid filename string. |
Sample Payload
{
"data": {
"type": "registry-provider-version-platforms",
"attributes": {
"os": "linux",
"arch": "amd64",
"shasum": "8f69533bc8afc227b40d15116358f91505bb638ce5919712fbb38a2dec1bba38",
"filename": "terraform-provider-aws_3.1.1_linux_amd64.zip"
}
}
}
Sample Request
curl \
--header "Authorization: Bearer $TOKEN" \
--header "Content-Type: application/vnd.api+json" \
--request POST \
--data @payload.json \
https://app.terraform.io/api/v2/organizations/hashicorp/registry-providers/private/hashicorp/aws/versions/3.1.1/platforms
Sample Response
{
"data": {
"id": "provpltfrm-BLJWvWyJ2QMs525k",
"type": "registry-provider-platforms",
"attributes": {
"os": "linux",
"arch": "amd64",
"filename": "terraform-provider-aws_3.1.1_linux_amd64.zip",
"shasum": "8f69533bc8afc227b40d15116358f91505bb638ce5919712fbb38a2dec1bba38",
"permissions": {
"can-delete": true,
"can-upload-asset": true
},
"provider-binary-uploaded": false
},
"relationships": {
"registry-provider-version": {
"data": {
"id": "provver-y5KZUsSBRLV9zCtL",
"type": "registry-provider-versions"
}
}
},
"links": {
"provider-binary-upload": "https://archivist.terraform.io/v1/object/dmF1b..."
}
}
}
Get All Platforms for a Single Version
GET /organizations/:organization_name/registry-providers/:registry_name/:namespace/:name/versions/:version/platforms
Parameters
Parameter | Description |
---|---|
:organization_name | The name of the organization the provider belongs to. |
:registry_name | Must be private . |
:namespace | The namespace of the provider. Must be the same as the organization_name for the provider. |
:name | The provider name. |
:version | The version of the provider. |
Status | Response | Reason |
---|---|---|
200 | JSON API document (type: "registry-providers" ) | Success |
403 | JSON API error object | Forbidden - public provider curation disabled |
404 | JSON API error object | Provider not found or user unauthorized to perform action |
Sample Request
curl \
--request GET \
--header "Authorization: Bearer $TOKEN" \
--header "Content-Type: application/vnd.api+json" \
https://app.terraform.io/api/v2/organizations/hashicorp/registry-providers/private/hashicorp/aws/versions/3.1.1/platforms
Sample Response
{
"data": [
{
"id": "provpltfrm-GSHhNzptr9s3WoLD",
"type": "registry-provider-platforms",
"attributes": {
"os": "darwin",
"arch": "amd64",
"filename": "terraform-provider-aws_3.1.1_darwin_amd64.zip",
"shasum": "fd580e71bd76d76913e1925f2641be9330c536464af9a08a5b8994da65a26cbc",
"permissions": {
"can-delete": true,
"can-upload-asset": true
},
"provider-binary-uploaded": true
},
"relationships": {
"registry-provider-version": {
"data": {
"id": "provver-y5KZUsSBRLV9zCtL",
"type": "registry-provider-versions"
}
}
},
"links": {
"provider-binary-download": "https://archivist.terraform.io/v1/object/dmF1b..."
}
},
{
"id": "provpltfrm-A1PHitiM2KkKpVoM",
"type": "registry-provider-platforms",
"attributes": {
"os": "darwin",
"arch": "arm64",
"filename": "terraform-provider-aws_3.1.1_darwin_arm64.zip",
"shasum": "de3c351d7f35a3c8c583c0da5c1c4d558b8cea3731a49b15f63de5bbbafc0165",
"permissions": {
"can-delete": true,
"can-upload-asset": true
},
"provider-binary-uploaded": true
},
"relationships": {
"registry-provider-version": {
"data": {
"id": "provver-y5KZUsSBRLV9zCtL",
"type": "registry-provider-versions"
}
}
},
"links": {
"provider-binary-download": "https://archivist.terraform.io/v1/object/dmF1b..."
}
}
],
"links": {
"self": "https://app.terraform.io/api/v2/organizations/hashicorp/registry-providers/private/hashicorp/aws/versions/3.1.1/platforms?page%5Bnumber%5D=1&page%5Bsize%5D=20",
"first": "https://app.terraform.io/api/v2/organizations/hashicorp/registry-providers/private/hashicorp/aws/versions/3.1.1/platforms?page%5Bnumber%5D=1&page%5Bsize%5D=20",
"prev": null,
"next": null,
"last": "https://app.terraform.io/api/v2/organizations/hashicorp/registry-providers/private/hashicorp/aws/versions/3.1.1/platforms?page%5Bnumber%5D=1&page%5Bsize%5D=20"
},
"meta": {
"pagination": {
"current-page": 1,
"page-size": 20,
"prev-page": null,
"next-page": null,
"total-pages": 1,
"total-count": 2
}
}
}
Note: The provider-binary-uploaded
property will be false
if that file has not been uploaded to Archivist. In this case, instead of including a link to provider-binary-download
, the response will include an upload link provider-binary-upload
.
Get a Platform
GET /organizations/:organization_name/registry-providers/:registry_name/:namespace/:name/versions/:version/platforms/:os/:arch
Parameters
Parameter | Description |
---|---|
:organization_name | The name of the organization the provider belongs to. |
:registry_name | Must be private . |
:namespace | The namespace of the provider. Must be the same as the organization_name for the provider. |
:name | The provider name. |
:version | The version of the provider. |
:os | The operating system of the provider platform. |
:arch | The architecture of the provider platform. |
Status | Response | Reason |
---|---|---|
200 | JSON API document (type: "registry-providers" ) | Success |
403 | JSON API error object | Forbidden - public provider curation disabled |
404 | JSON API error object | Provider not found or user unauthorized to perform action |
Sample Request
curl \
--request GET \
--header "Authorization: Bearer $TOKEN" \
--header "Content-Type: application/vnd.api+json" \
https://app.terraform.io/api/v2/organizations/hashicorp/registry-providers/private/hashicorp/aws/versions/3.1.1/platforms/linux/amd64
Sample Response
{
"data": {
"id": "provpltfrm-BLJWvWyJ2QMs525k",
"type": "registry-provider-platforms",
"attributes": {
"os": "linux",
"arch": "amd64",
"filename": "terraform-provider-aws_3.1.1_linux_amd64.zip",
"shasum": "8f69533bc8afc227b40d15116358f91505bb638ce5919712fbb38a2dec1bba38",
"permissions": {
"can-delete": true,
"can-upload-asset": true
},
"provider-binary-uploaded": true
},
"relationships": {
"registry-provider-version": {
"data": {
"id": "provver-y5KZUsSBRLV9zCtL",
"type": "registry-provider-versions"
}
}
},
"links": {
"provider-binary-download": "https://archivist.terraform.io/v1/object/dmF1b..."
}
}
}
Note: The provider-binary-uploaded
property will be false
if that file has not been uploaded to Archivist. In this case, instead of including a link to provider-binary-download
, the response will include an upload link provider-binary-upload
.
Delete a Platform
DELETE /organizations/:organization_name/registry-providers/:registry_name/:namespace/:name/versions/:version/platforms/:os/:arch
Parameters
Parameter | Description |
---|---|
:organization_name | The name of the organization to delete a provider platform from. The organization must already exist, and the token authenticating the API request must belong to the "owners" team or a member of the "owners" team. |
:registry_name | Must be private . |
:namespace | The namespace of the provider for which the platform is being deleted. For private providers this is the same as the :organization_name parameter. |
:name | The name of the provider for which the platform is being deleted. |
:version | The version for which the platform is being deleted. |
:os | The operating system of the provider platform that is being deleted. |
:arch | The architecture of the provider platform that is being deleted. |
Status | Response | Reason |
---|---|---|
204 | No Content | Success |
403 | JSON API error object | Forbidden - public provider curation disabled |
404 | JSON API error object | Provider not found or user not authorized to perform action |
Sample Request
curl \
--header "Authorization: Bearer $TOKEN" \
--header "Content-Type: application/vnd.api+json" \
--request DELETE \
https://app.terraform.io/api/v2/organizations/hashicorp/registry-providers/private/hashicorp/aws/versions/3.1.1/platforms/linux/amd64