[[["易于理解","easyToUnderstand","thumb-up"],["解决了我的问题","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["很难理解","hardToUnderstand","thumb-down"],["信息或示例代码不正确","incorrectInformationOrSampleCode","thumb-down"],["没有我需要的信息/示例","missingTheInformationSamplesINeed","thumb-down"],["翻译问题","translationIssue","thumb-down"],["其他","otherDown","thumb-down"]],["最后更新时间 (UTC):2025-08-11。"],[],[],null,["# Managing Tenant Projects\n\nThis page describes how to create, remove, and delete\n[tenant projects](/service-infrastructure/docs/glossary#tenant).\n\nYou use the Service Consumer Management API to create and configure tenant projects,\nGoogle Cloud projects that are used to host your\n[managed service](/service-infrastructure/docs/glossary#managed) resources dedicated to a single\n[service consumer](/service-infrastructure/docs/glossary#consumer). Each tenant project is associated\nwith a [tenancy unit](/service-infrastructure/docs/glossary#tenancy).\n\nA tenancy unit can contain multiple tenant projects, each assigned a\n`tag: string` identifier that you can use to indicate the purpose of the project\nand to refer to it when deprovisioning.\n\nAfter creation, a tenant project is just a Google Cloud project in your\norganization. You can use any management tools to work with it as you would\nnormally use for Google Cloud project.\n\nCreating a tenant project\n-------------------------\n\nTo create a tenant project and add it to a tenancy unit, call the\n[`services.tenancyUnits.addProject`](/service-infrastructure/docs/service-consumer-management/reference/rest/v1/services.tenancyUnits/addProject)\nmethod.\n\nThe following example adds a new tenant project with the tag `tag1` to a tenancy\nunit using the REST API: \n\n```\nPOST https://serviceconsumermanagement.googleapis.com/v1/services/your-service.example.com/projects/12345678901/tenancyUnits/absdef:addProject\n```\n\nThe call includes the following data: \n\n```json\n{\"tag\":\"tag1\", \"project_config\":{\"folder\":\"folders/9876543210\", \"tenant_project_policy\":{\"policy_bindings\":{\"role\":\"roles/owner\", \"members\":\"user:bob@example.com\"}}, \"billing_config\":{\"billing_account\":\"billingAccounts/123456-472F22-28F9AA\"}}}\n```\n\nThis call returns a long running [operation](/service-infrastructure/docs/glossary#operation) that you\ncan query to confirm the project creation was successful.\n\nThe new tenant project is configured with a project lien: a property set on the\ntenant project to prevent accidental deletion. You must call the\n[`services.tenancyUnits.removeProject`](/service-infrastructure/docs/service-consumer-management/reference/rest/v1/services.tenancyUnits/removeProject)\nmethod to release the lien and delete the project. It is not recommended to\nbypass this protection.\n\nThe tenant project is created in the folder that you specified during\n[Setup and Configuration](/service-infrastructure/docs/service-consumer-management/getting-started).\nIt is not recommended to move a project to a different folder after it is\ncreated.\n\nThe Service Consumer Management API service account is the creator and owner of tenant\nprojects, in addition to any other owners that are specified in the tenant\nproject configuration. It is not recommended to remove this account as an owner.\n\nIn some cases you might want to update an existing Google Cloud project to become a\ntenant project rather than create a new tenant project. To add an existing\nGoogle Cloud project to a tenancy unit, call the\n[`services.tenancyUnits.attachProject`](/service-infrastructure/docs/service-consumer-management/reference/rest/v1/services.tenancyUnits/attachProject)\nmethod.\n\nRemoving a tenant project\n-------------------------\n\nTo remove a tenant project with the tag `abc`, call the\n[`services.tenancyUnits.removeProject`](/service-infrastructure/docs/service-consumer-management/reference/rest/v1/services.tenancyUnits/removeProject)\nmethod as illustrated by the following example: \n\n```\nPOST https://serviceconsumermanagement.googleapis.com/v1/services/your-service.example.com/projects/12345678901/tenancyUnits/absdef:removeProject\n```\n\nThe call includes the following data: \n\n```json\n{\"tag\":\"abc\"}\n```\n\nThis operation removes the project lien, deletes the project and all resources\nin it, and deletes any associated metadata from the tenancy unit.\n\nThis deletes the project, and removes all metadata about it from the tenancy\nunit. If you wish to delete the project, but keep a record of it, call the\n[`services.tenancyUnits.deleteProject`](/service-infrastructure/docs/service-consumer-management/reference/rest/v1/services.tenancyUnits/deleteProject)\nmethod instead. This method deletes the project and retains the metadata,\nannotating it with a state of `DELETED`. To undelete a deleted project, call the\n[`services.tenancyUnits.undeleteProject`](/service-infrastructure/docs/service-consumer-management/reference/rest/v1/services.tenancyUnits/undeleteProject)\nmethod."]]