How to replicate the Amazon S3 bucket across regions?
Amazon S3 is a storage for the internet. Amazon S3 is also called Amazon Simple Storage Service. Availability and durability are the key priorities. We need to ensure that data is available at any time and that stored data doesn’t suffer from bit rot, degradation or other corruption.
To set up cross-region replication, you need source and destination buckets in different AWS regions and both buckets must have versioning enabled. Start by creating two buckets inside the Amazon S3 console.
Single bucket replication (Files added to Bucket 1 are automatically added to Bucket 2)
To store files to a 2nd S3 bucket automatically upon uploading, the built-in “Cross-Region Replication” is the method to use.
The following steps help you to set up the replication
Click on the properties of the S3 bucket you want to copy from the enable versioning.
In “Cross-Region Replication”, click on “Enable Cross-Region Replication”
Source Bucket: Select the Source S3 bucket to use. (You can select the entire source or files with a prefix)
Destination Bucket: Select the Destination by picking another region to copy to. (Replication does not work in the same region). If you have already created a bucket in the destination region, you can select the same.
Destination storage class: You can choose how files to be stored in the destination bucket.
Create/select IAM role: create a new role with the appropriate permissions to copy files to the destination bucket.
Once you press Save, Cross-Region Replication is now set up. Any files you upload to the source bucket from now on will automatically be added to the destination bucket a moment later.
Also, Cross-Region Replication can’t (currently) be chained to copy from a source to more than one destination, however, there’s a way to do that using the Lambda function.
At Velan, our server support engineers can help you with the setup of S3 bucket replication across different regions for your server. We troubleshoot problems like these for our clients every day. If you are interested in our service, please fill the Quick connect form to get in touch with us.