Granting Read and Write Permissions on a Bucket to Other HUAWEI CLOUD Accounts
Scenario
This case describes how to grant other HUAWEI CLOUD accounts the read and write permissions on OBS buckets. The account refers to a HUAWEI CLOUD account, excluding IAM users under the account. For details about how to grant permissions to an IAM user, see Granting Access Permissions on Buckets and Bucket Resources to IAM Users under Other Accounts.
Recommended Configuration
You are advised to use bucket policies to grant permissions to other accounts.
Configuration Precautions
The preset read/write mode of OBS has the following permissions:
- GetObject: downloading objects
- PutObject: uploading objects
- GetObjectVersion: downloading versioned objects
- DeleteObjectVersion: deleting objects versions
- DeleteObject: deleting objects
After the configuration is complete, the authorized account can perform read and write operations (uploading, downloading, and deleting all objects in the bucket) through APIs or SDKs. In addition, the account can perform read and write operations by mounting external buckets to OBS Browser+. However, an additional ListBucket permission needs to be configured. You cannot access buckets of other accounts on OBS Console.
After the ListBucket permission is configured, a message may still be displayed indicating that you do not have the permission to access the added external bucket through OBS Browser+.
Error cause: The loading on the OBS Browser+ bucket details page invokes some other OBS APIs. However, such operations are not allowed by the read and write permissions. Therefore, a message "Access denied. Check the response permission" or "This operation is not allowed on the requested resource" is displayed, however, existing permissions are not affected.
Procedure
- In the navigation pane of OBS Console, choose Buckets.
- In the bucket list, click the bucket name you want to go to the Overview page.
- In the navigation pane, choose Permissions > Bucket Policy.
- On the Bucket Policies page, click Create.
- Locate the row containing Bucket read and write and click Use Policy Template.
- Configure parameters for a bucket policy. Figure 1 Configuring bucket policy parameters
Table 1 Parameter description Parameter
Description
Policy View
Set this parameter based on your own habits. Example: Visual editor.
Policy Name
Name of the custom policy
Policy Content
- Select Allow.
- Set Principal to Other account.
- Account ID: Enter the ID of the account to which you want to grant permissions. You can obtain it from the My Credentials page of the account.
- IAM User ID: Enter the account ID. You can obtain it from the My Credentials page of the account.
- User Policy: Select Include specified users.
- Parameters under Resources:
- Resource: Select both Current bucket and Object in bucket.
- Resource Policy: Select Include specified resources.
- After configuring the required parameters, click Next.
- Ensure all the configurations are correct and click Create.
Last Article: Granting Permissions to Other Accounts
Next Article: Granting Specific Operation Permissions on a Bucket to Other Accounts
Did this article solve your problem?
Thank you for your score!Your feedback would help us improve the website.