Attach an existing project to the tenancy unit as a new tenant resource. The project could either be the tenant project reserved by calling tenancyUnits.addProject under a tenancy unit of a service producer's project of a managed service, or from a separate project. The caller is checked against a set of permissions as if calling tenancyUnits.addProject on the same service consumer. To trigger the attachment, the targeted tenant project must be in a folder. Make sure the ServiceConsumerManagement service account is the owner of that project. These two requirements are already met if the project is reserved by calling tenancyUnits.addProject. Operation<response: Empty>.
HTTP request
POST https://serviceconsumermanagement.googleapis.com/v1/{name=services/*/*/*/tenancyUnits/*}:attachProject
Name of the tenancy unit that the project will be attached to. Such as 'services/service.googleapis.com/projects/12345/tenancyUnits/abcd'.
Authorization requires the following Google IAM permission on the specified resource name:
serviceconsumermanagement.tenancyu.addResource
Request body
The request body contains data with the following structure:
JSON representation
{"tag": string,// Union field resource can be only one of the following:"reservedResource": string,"externalResource": string// End of list of possible types for union field resource.}
Fields
tag
string
Tag of the tenant resource after attachment. Must be less than 128 characters. Required.
Union field resource. Resource to be attached. This project must either be a reserved project in the tenancy unit for a service producer project, or an separate project which is not an existing tenant project for any service. resource can be only one of the following:
reservedResource
string
When attaching a reserved project already in tenancy units, this is the tag of a tenant resource under the tenancy unit for the managed service's service producer project. The reserved tenant resource must be in an active state.
externalResource
string
When attaching an external project, this is in the format of projects/{project_number}.
Response body
If successful, the response body contains an instance of Operation.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-05-14 UTC."],[],[],null,["# Method: services.tenancyUnits.attachProject\n\n- [HTTP request](#body.HTTP_TEMPLATE)\n- [Path parameters](#body.PATH_PARAMETERS)\n- [Request body](#body.request_body)\n - [JSON representation](#body.request_body.SCHEMA_REPRESENTATION)\n- [Response body](#body.response_body)\n- [Authorization Scopes](#body.aspect)\n- [Try it!](#try-it)\n\nAttach an existing project to the tenancy unit as a new tenant resource. The project could either be the tenant project reserved by calling `tenancyUnits.addProject` under a tenancy unit of a service producer's project of a managed service, or from a separate project. The caller is checked against a set of permissions as if calling `tenancyUnits.addProject` on the same service consumer. To trigger the attachment, the targeted tenant project must be in a folder. Make sure the ServiceConsumerManagement service account is the owner of that project. These two requirements are already met if the project is reserved by calling `tenancyUnits.addProject`. Operation\\\u003cresponse: Empty\\\u003e.\n\n### HTTP request\n\n`POST https://serviceconsumermanagement.googleapis.com/v1/{name=services/*/*/*/tenancyUnits/*}:attachProject`\n\nThe URL uses [gRPC Transcoding](https://github.com/googleapis/googleapis/blob/master/google/api/http.proto) syntax.\n\n### Path parameters\n\n### Request body\n\nThe request body contains data with the following structure:\n\n### Response body\n\nIf successful, the response body contains an instance of [Operation](/service-infrastructure/docs/service-consumer-management/reference/rest/Shared.Types/Operation).\n\n### Authorization Scopes\n\nRequires the following OAuth scope:\n\n- `https://www.googleapis.com/auth/cloud-platform`\n\nFor more information, see the [Authentication Overview](https://cloud.google.com/docs/authentication/).\n\nTry it!\n-------"]]