0

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

Samane
  • 500
  • 7
  • 23
Sri Ram
  • 33
  • 6

1 Answers1

1

You need to make sure to create the AmazonRDSClient in a specific region and when you create the CopyDBSnapshotRequest you refer to the snapshot with the full identifier.

Here some pseudo code to copy from us-east zone to eu_central zone

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);

Make sure to review Java API for RDS and Copying a DB Snapshot to Another Region

Frederic Henri
  • 51,761
  • 10
  • 113
  • 139