-
Notifications
You must be signed in to change notification settings - Fork 709
added cross-account OSS bucket configuration #22632
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: release-8.5
Are you sure you want to change the base?
Changes from 7 commits
9838e39
fdd5c15
df26b42
03a47b9
f070954
094e0a7
120659c
2c02d9d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -177,6 +177,51 @@ For more information, see [Create a bucket](https://www.alibabacloud.com/help/en | |
|
|
||
| 5. Copy the **Role ARN** (for example: `acs:ram::<Your-Account-ID>:role/tidb-cloud-audit-role`) for later use. | ||
|
|
||
|
|
||
| **Cross-Account OSS Bucket Configuration** | ||
|
|
||
| If the OSS bucket storing the audit logs and the role accessing the OSS bucket are in different cloud accounts, the configuration process is slightly different. | ||
|
|
||
| **1. RAM Policy Configuration** | ||
| When creating the RAM policy, you need to add the information of User Account 2 in the Resource field. Define the policy using the following JSON script: | ||
|
|
||
| ```json | ||
| { | ||
| "Version": "1", | ||
| "Statement": [ | ||
| { | ||
| "Effect": "Allow", | ||
| "Action": "oss:PutObject", | ||
| "Resource": "acs:oss:oss-<region>:<User Account 2>:<bucket-name>/*" | ||
| } | ||
| ] | ||
| } | ||
| ``` | ||
|
|
||
| **2. Bucket Policy Configuration** | ||
| In addition, you also need to configure a Bucket Policy on the destination OSS bucket to allow the assumed role from the different account to access it. Use the following configuration: | ||
|
hfxsd marked this conversation as resolved.
Outdated
|
||
|
|
||
| ```json | ||
| { | ||
| "Version": "1", | ||
| "Statement": [ | ||
| { | ||
| "Action": [ | ||
| "oss:GetObject" | ||
| ], | ||
| "Effect": "Allow", | ||
| "Principal": [ | ||
| "arn:sts::<User Account 1>:assumed-role/<role-name>/*" | ||
| ], | ||
| "Resource": [ | ||
| "acs:oss:*:<User Account 2>:<bucket-name>/*" | ||
| ] | ||
| } | ||
| ] | ||
| } | ||
| ``` | ||
|
Comment on lines
+181
to
+224
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hello! As a senior technical writer, I've reviewed this section and have a suggestion to improve its technical accuracy, clarity, and adherence to our documentation style guide. Here's a summary of the proposed changes:
I've provided a ready-to-commit suggestion that incorporates all these improvements. Thank you for your contribution! ##### Cross-account OSS bucket configuration
If your OSS bucket and RAM role are in different Alibaba Cloud accounts, you need to perform additional configurations for cross-account access. For the purpose of this guide, assume that the RAM role for TiDB Cloud is in `Account 1` and the OSS bucket is in `Account 2`.
1. **Configure the RAM policy in `Account 1`**
When you create the RAM policy for the role in `Account 1`, you need to specify the bucket in `Account 2` as the resource. Use the following policy:
```json
{
"Version": "1",
"Statement": [
{
"Effect": "Allow",
"Action": "oss:PutObject",
"Resource": "acs:oss:oss-<region>:<bucket-account-id>:<bucket-name>/*"
}
]
}
```
In the policy, replace `<bucket-account-id>` with the ID of `Account 2`.
2. **Configure the bucket policy in `Account 2`**
In `Account 2`, you also need to configure a bucket policy on the destination OSS bucket to grant the RAM role from `Account 1` permission to write objects. Use the following policy:
```json
{
"Version": "1",
"Statement": [
{
"Action": "oss:PutObject",
"Effect": "Allow",
"Principal": {
"RAM": [
"acs:ram::<role-account-id>:role/<role-name>"
]
},
"Resource": "acs:oss:*:<bucket-account-id>:<bucket-name>/*"
}
]
}
```
In the policy, make the following replacements:
- Replace `<role-account-id>` with the ID of `Account 1`.
- Replace `<role-name>` with the name of the RAM role you created in `Account 1`.
- Replace `<bucket-account-id>` with the ID of `Account 2`.References
|
||
|
|
||
|
hfxsd marked this conversation as resolved.
|
||
|
|
||
| #### Step 3. Enable audit logging | ||
|
|
||
| In the TiDB Cloud console, go back to the **Database Audit Log Storage Configuration** dialog where you got the TiDB Cloud account ID, and then take the following steps: | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.