目标存储桶或其项目中不得存在使用存储桶资源类型 (storage.googleapis.com/Bucket) 或对象资源类型 (storage.googleapis.com/Object) 的 IAM 条件。如果项目中的任何存储桶存在使用这两种资源类型的 IAM 条件,则无法将受管文件夹转移到该项目中的任何存储桶,即使该条件稍后被移除也是如此。
不支持事件驱动型转移。
不支持清单传输。
IAM 权限
Google 管理的服务账号需要具有以下 Google Cloud Identity and Access Management (IAM) 权限。
向 Google 代管式服务账号授予受管文件夹权限后,该账号便可以修改目标文件夹的 IAM 政策,如果是在项目级授予角色,则还可以修改所有文件夹的 IAM 政策。这会带来安全风险:具有作业修改权限的用户可能会利用此漏洞向恶意行为者授予特权。为降低此风险,请考虑在专用 Google Cloud 项目中隔离托管文件夹传输。
[[["易于理解","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-09-03。"],[],[],null,["# Transfer Cloud Storage managed folders\n\n[Cloud Storage managed folders](/storage/docs/managed-folders) provide\nfine-grained access control to objects in Cloud Storage buckets. Permissions\ncan be set at a folder level within buckets that use universal bucket-level\naccess. When transferring objects between Cloud Storage buckets with\nStorage Transfer Service, these managed folder permissions can be retained.\n\nLimitations\n-----------\n\nThe following limitations apply to transfers of managed folders:\n\n- The destination bucket must use [uniform bucket-level access](/storage/docs/uniform-bucket-level-access).\n- Managed folder transfers do not support the `deleteObjectsUniqueInSink` or `deleteObjectsFromSourceAfterTransfer` options.\n- There must be no [IAM Conditions](/iam/docs/conditions-overview) on the destination bucket or its project that use the *bucket* resource type (`storage.googleapis.com/Bucket`) or the *object* resource type (`storage.googleapis.com/Object`). If any bucket within a project has an IAM Condition that uses either of these resource types, managed folders cannot be transferred to any of the buckets within that project, even if the condition is later removed.\n- Event-driven transfers are not supported.\n- Manifest transfers are not supported.\n\nIAM permissions\n---------------\n\nThe following Google Cloud Identity and Access Management (IAM)\npermissions are required by the Google-managed service account.\n\nFor both the source and the destination, permissions can be set at the bucket\nlevel, or can be\n[set on the managed folder](/storage/docs/access-control/using-iam-for-managed-folders).\nTo set permissions on a destination managed folder, that folder must already\nexist.\n\nWe do not recommend setting managed folder permissions at a project level;\nsee [Security considerations](#security_considerations) for additional info.\n\nOn the source bucket or managed folder:\n\n- `storage.managedFolders.getIamPolicy`\n- `storage.managedFolders.list`\n- `storage.managedFolders.get`\n\nOn the destination bucket or managed folder:\n\n- `storage.managedFolders.setIamPolicy`\n- `storage.managedFolders.list`\n- `storage.managedFolders.create`\n\nThese are in addition to the standard permissions required by Storage Transfer Service:\n\n- [Configure access to a source: Cloud Storage](/storage-transfer/docs/source-cloud-storage)\n- [Configure access to a sink: Cloud Storage](/storage-transfer/docs/sink-cloud-storage)\n\nTo grant the required managed folder permissions,\n[create a custom role](/iam/docs/creating-custom-roles) with only the\npermissions required.\n\nCreate a managed folder transfer\n--------------------------------\n\nTo create a transfer containing a managed folder, specify\n`managedFolderTransferEnabled: true` in your `transferSpec`. You can optionally\nspecify a `path` value to transfer only a specific managed folder. \n\n POST https://storagetransfer.googleapis.com/v1/transferJobs\n {\n \"name\": \"transferjobs/\u003cvar translate=\"no\"\u003eNAME\u003c/var\u003e\",\n \"projectId\": \"\u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e\",\n \"transferSpec\": {\n \"gcsDataSource\": {\n \"bucketName\": \"\u003cvar translate=\"no\"\u003eSOURCE_BUCKET\u003c/var\u003e\",\n \"path\": \"\u003cvar translate=\"no\"\u003eSOURCE_PATH\u003c/var\u003e\",\n \"managedFolderTransferEnabled\": true\n },\n \"gcsDataSink\": {\n \"bucketName\": \"\u003cvar translate=\"no\"\u003eDESTINATION_BUCKET\u003c/var\u003e\",\n \"path\": \"\u003cvar translate=\"no\"\u003eDESTINATION_PATH\u003c/var\u003e\",\n }\n },\n \"status\": \"ENABLED\"\n }\n\nIf the correct managed transfer permissions are not set at the source and the\ndestination, the transfer fails.\n\nSee [Create transfers](/storage-transfer/docs/create-transfers?tab=rest#create-a-transfer)\nfor details on creating a transfer using the REST API, or refer to the\n[`transferJobs.create` reference](/storage-transfer/docs/reference/rest/v1/transferJobs/create).\n\nSecurity considerations\n-----------------------\n\nGranting managed folder permissions to a Google-managed service account enables\nthe account to modify IAM policies on destination folders, or on all folders\nif the role is granted at the project level. This poses a security risk:\na user with job edit permissions could exploit this to grant privileges to a\nmalicious actor. To mitigate this risk, consider isolating managed folder\ntransfers within a dedicated Google Cloud project.\n\nCloud Logging\n-------------\n\nManaged folder actions are logged by Cloud Logging. See\n[Cloud Logging for Storage Transfer Service](/storage-transfer/docs/transfer-logs)\nfor details.\n\nTroubleshooting\n---------------\n\nFor help creating and managing managed folders, refer to the\n[Troubleshooting](/storage/docs/troubleshooting#folders) page."]]