Movatterモバイル変換


[0]ホーム

URL:


HashiConf 2025Don't miss the live stream of HashiConf Day 2 happening now View live stream

You are viewing documentation for version v202507-1.View latest version.

Admins and operators who install and maintain their organization's Terraform Enterprise instance are able to use themodule-consumers endpoint.

This endpoint is deprecated: We will remove this endpoint in a future release. Use theRegistry Sharing API instead. Continue using theAdmin Organizations API to configure global module sharing.

There are two ways to configure module sharing using the Admin API:

  • This endpoint, which allows an organization to share modules with a specific list of other organizations.
  • Theupdate an organization endpoint, whosedata.attributes.global-module-sharing property allows an organization to share modules with every organization in the instance.

Update an Organization's Module Consumers

This API endpoint is available in Terraform Enterprise as of version 202012-1.

PATCH /admin/organizations/:name/module-consumers

This endpoint sets the list of organizations that can use modules from the sharing organization's private registry. Sharing with specific organizations will automatically turn off global module sharing, which is configured with theupdate an organization endpoint (via thedata.attributes.global-module-sharing property).

ParameterDescription
:nameThe name of the organization whose registry is being shared
StatusResponseReason
200JSON API document (type: "module-partnerships")The list of module consumers was successfully updated
404JSON API error objectOrganization not found or user unauthorized to perform action
422JSON API error objectMalformed request body (missing attributes, wrong types, etc.)

Request Body

This PATCH endpoint requires a JSON object with the following properties as a request payload.

Key pathTypeDefaultDescription
data.typestringMust be"module-partnerships"
data.attributes.module-consuming-organization-idsarray[string]A list of external ids for organizations that will be able to access modules in the producing organization's registry. These should have anorg- prefix.

Sample Payload

{  "data": {    "type": "module-partnerships",    "attributes": {      "module-consuming-organization-ids": [        "org-939hp5K7kecppVmd"      ]    }  }}

Sample Request

curl \  --header "Authorization: Bearer $TOKEN" \  --header "Content-Type: application/vnd.api+json" \  --request PATCH \  --data @payload.json \  https://tfe.example.com/api/v2/admin/organizations/my-organization/module-consumers

Sample Response

{  "data": [    {      "id": "mp-tQATArr4gyYDBvkF",      "type": "module-partnerships",      "attributes": {        "consuming-organization-id": "org-939hp5K7kecppVmd",        "consuming-organization-name": "other-organization",        "producing-organization-id": "org-etdex8r9VLnyHFct",        "producing-organization-name": "my-organization"      }    }  ]}
Edit this page on GitHub

[8]ページ先頭

©2009-2025 Movatter.jp