0

I am new in amazon web Services. How to copy RDS Snapshot one region to another Region using aws-sdk-api java programmatic.

4

1 回答 1

1

您需要确保AmazonRDSClient在特定区域中创建,并且在创建时CopyDBSnapshotRequest引用具有完整标识符的快照。

这里有一些从 us-east 区域复制到 eu_central 区域的伪代码

AmazonRDSClient rdsClient = new AmazonRDSClient(/*add your credentials and the proper constructor overload*/);
rdsClient.setRegion(Region.getRegion(Regions.EU_CENTRAL_1));

CopyDBSnapshotRequest copySnapshot = new CopyDBSnapshotRequest();
copySnapshot.setSourceDBSnapshotIdentifier("arn:aws:rds:us-east-1:123456789012:snapshot:mysql-instance1-snapshot-20130805");
copySnapshot.setTargetDBSnapshotIdentifier("mysql-instance1-snapshot-20130805-copy");

DBSnapshot dbSnapshot = rdsClient.copyDBSnapshot(copySnapshot);

请务必查看Java API for RDS将数据库快照复制到另一个区域

于 2015-10-02T07:56:26.530 回答