Registry Partnership API Endpoint
Admins and operators who install and maintain their organization's Terraform Enterprise instance are able to use the registry-partnerships
endpoint to configure registry sharing.
Introduction
There are two ways to configure registry sharing via the Admin API:
- This endpoint, which allows an organization to share modules and providers with a specific list of other organizations.
- The update an organization endpoint, whose
data.attributes.global-module-sharing
anddata.attributes.global-provider-sharing
properties allows an organization to share modules and providers with every organization in the instance.
Enabling one option will automatically disable the other. For more information, see Administration: Registry Sharing.
Update an Organization's Provider Partnership
This API endpoint is available in Terraform Enterprise as of version 202301-1.
PUT /admin/organizations/:name/registry-partnerships
This endpoint sets the list of organizations that can use modules and providers from the sharing organization's private registry. Sharing with specific organizations will automatically turn off global module and/or provider sharing, which is configured with the update an organization endpoint (via the data.attributes.global-module-sharing
and data.attributes.global-provider-sharing
properties).
Parameter | Description |
---|---|
:name | The name of the organization whose registry is being shared |
Status | Response | Reason |
---|---|---|
204 | No content | The list of module and provider consumers was successfully updated |
404 | JSON API error object | Organization not found or user unauthorized to perform action |
422 | JSON API error object | Malformed request body (missing attributes, wrong types, etc.) |
Request Body
This PUT endpoint requires a JSON object with the following properties as a request payload.
Key path | Type | Default | Description |
---|---|---|---|
data.type | string | Must be "registry-partnerships" | |
data.attributes.module-consumers | array[string] | A list of organization names that will be able to access modules in the producing organization's registry. | |
data.attributes.provider-consumers | array[string] | A list of organization names that will be able to access providers in the producing organization's registry. |
Sample Payload
{ "data": { "type": "registry-partnerships", "attributes": { "module_consumers": ["org1-name"], "provider_consumers": ["org1-name", "org2-name"] } }}
Sample Request
curl \ --header "Authorization: Bearer $TOKEN" \ --header "Content-Type: application/vnd.api+json" \ --request PUT \ --data @payload.json \ https://tfe.example.com/api/v2/admin/organizations/my-organization/registry-partnerships
Sample Response
The response body will be empty if successful.