Skip to content

Commit 68c9380

Browse files
authored
add storage access configuration (#22232)
1 parent 5a218e0 commit 68c9380

File tree

1 file changed

+115
-1
lines changed

1 file changed

+115
-1
lines changed

tidb-cloud/premium/backup-and-restore-premium.md

Lines changed: 115 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,11 +192,15 @@ To restore backups from cloud storage, do the following:
192192
2. On the **Select Backup Storage Location** page, provide the following information:
193193

194194
- **Cloud Provider**: select the cloud provider where your backup files are stored.
195-
- **Region**: if your cloud provider is Alibaba Cloud OSS, select a Region.
195+
- **Region**: if your cloud provider is Alibaba Cloud OSS, select a region.
196196
- **Backup Files URI**: enter the URI of the top-level folder that contains your backup files.
197197
- **Access Key ID**: enter your access key ID.
198198
- **Access Key Secret**: enter your access key secret.
199199

200+
> **Tip:**
201+
>
202+
> To create an access key for your storage bucket, see [Configure Amazon S3 access using an AWS access key](#configure-amazon-s3-access-using-an-aws-access-key) and [Configure Alibaba Cloud OSS access](#configure-alibaba-cloud-oss-access).
203+
200204
3. Click **Verify Backup and Next**.
201205

202206
4. If the verification is successful, the **Restore to a New Instance** page appears. Review the backup information displayed at the top of the page, and then follow the steps in [Create a {{{ .premium }}} Instance](/tidb-cloud/premium/create-tidb-instance-premium.md) to restore the backup to a new instance.
@@ -208,3 +212,113 @@ To restore backups from cloud storage, do the following:
208212
## Limitations
209213

210214
Currently, manual backups are not supported for {{{ .premium }}} instances.
215+
216+
## References
217+
218+
This section describes how to configure access for Amazon S3 and Alibaba Cloud OSS.
219+
220+
### Configure Amazon S3 access using an AWS access key
221+
222+
It is recommended that you use an IAM user, rather than the AWS account root user, to create an access key.
223+
224+
Take the following steps to configure an access key:
225+
226+
1. Create an IAM user and access key.
227+
228+
1. Create an IAM user. For more information, see [Create an IAM user in your AWS account](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_users_create.html#id_users_create_console).
229+
2. Sign in to the [IAM console](https://console.aws.amazon.com/iam) using your AWS account ID or account alias, and your IAM user name and password.
230+
3. Create an access key. For more information, see [Manage access keys for IAM users](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_access-keys.html#Using_CreateAccessKey).
231+
232+
2. Grant permissions to the IAM user.
233+
234+
Create a policy with only the permissions required for your task and attach it to the IAM user. To restore data to a {{{ .premium }}} instance, grant the `s3:GetObject`, `s3:GetBucketLocation`, and `s3:ListBucket` permissions.
235+
236+
The following is an example policy that allows TiDB Cloud to restore data from a specific folder in your Amazon S3 bucket.
237+
238+
```json
239+
{
240+
"Version": "2012-10-17",
241+
"Statement": [
242+
{
243+
"Sid": "AllowGetBucketLocation",
244+
"Effect": "Allow",
245+
"Action": "s3:GetBucketLocation",
246+
"Resource": "arn:aws:s3:::<Your S3 bucket name>"
247+
},
248+
{
249+
"Sid": "AllowListPrefix",
250+
"Effect": "Allow",
251+
"Action": "s3:ListBucket",
252+
"Resource": "arn:aws:s3:::<Your S3 bucket name>",
253+
"Condition": {
254+
"StringLike": {
255+
"s3:prefix": "<Your backup folder>/*"
256+
}
257+
}
258+
},
259+
{
260+
"Sid": "AllowReadObjectsInPrefix",
261+
"Effect": "Allow",
262+
"Action": "s3:GetObject",
263+
"Resource": "arn:aws:s3:::<Your S3 bucket name>/<Your backup folder>/*"
264+
}
265+
]
266+
}
267+
```
268+
269+
In the preceding policy, replace `<Your S3 bucket name>` and `<Your backup folder>` with your actual bucket name and backup directory. This configuration follows the principle of least privilege by limiting access to only the necessary backup files.
270+
271+
> **Note:**
272+
>
273+
> TiDB Cloud does not store your access keys. To maintain security, [delete the access key](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_access-keys.html#Using_CreateAccessKey) after the import or export task is complete.
274+
275+
### Configure Alibaba Cloud OSS access
276+
277+
To grant TiDB Cloud access to your Alibaba Cloud OSS bucket, you need to create an AccessKey pair for the bucket.
278+
279+
Take the following steps to configure an AccessKey pair:
280+
281+
1. Create a RAM user and obtain the AccessKey pair. For more information, see [Create a RAM user](https://www.alibabacloud.com/help/en/ram/user-guide/create-a-ram-user).
282+
283+
In the **Access Mode** section, select **Using permanent AccessKey to access**.
284+
285+
2. Create a custom policy with the required permissions. For more information, see [Create custom policies](https://www.alibabacloud.com/help/en/ram/user-guide/create-a-custom-policy).
286+
287+
- In the **Effect** section, select **Allow**.
288+
- In the **Service** section, select **Object Storage Service**.
289+
- In the **Action** section, select the required permissions. To restore a backup to a TiDB Cloud instance, grant the `oss:ListObjects` and `oss:GetObject` permissions.
290+
291+
> **Tip:**
292+
>
293+
> To enhance security for restore operations, you can restrict access to the specific folder (`oss:Prefix`) where your backup files are stored rather than granting access to the entire bucket.
294+
295+
The following JSON example shows a policy for a restore task. This policy restricts access to a specific bucket and backup folder.
296+
297+
```json
298+
{
299+
"Version": "1",
300+
"Statement": [
301+
{
302+
"Effect": "Allow",
303+
"Action": "oss:ListObjects",
304+
"Resource": "acs:oss:*:*:<Your bucket name>",
305+
"Condition": {
306+
"StringLike": {
307+
"oss:Prefix": "<Your backup folder>/*"
308+
}
309+
}
310+
},
311+
{
312+
"Effect": "Allow",
313+
"Action": "oss:GetObject",
314+
"Resource": "acs:oss:*:*:<Your bucket name>/<Your backup folder>/*"
315+
}
316+
]
317+
}
318+
```
319+
320+
- In the **Resource** section, select the bucket and the specific objects in the bucket.
321+
322+
3. Attach the custom policies to the RAM user.
323+
324+
For more information, see [Grant permissions to a RAM user](https://www.alibabacloud.com/help/en/ram/user-guide/grant-permissions-to-the-ram-user).

0 commit comments

Comments
 (0)