Hello Readers!! We are again back with another exciting topic i.e. How to set up S3 Cross Region Replication in AWS. First, let’s see what is cross region replication in AWS, and after that, we will see how we can perform its setup.
Cross Region Replication:
Cross-region replication (CRR) is a feature provided by Amazon Simple Storage Service (S3) in AWS that allows automatic replication of data across different AWS regions. By using this, we can create a replica of our S3 bucket in a different region, which helps to enhance data durability, availability, and compliance. By replicating our data across multiple regions, CRR helps increase the durability of our objects. This enables faster access to our data for users in that region, reducing latency and improving overall availability.
Setup S3 Cross Region Replication in AWS:
Step 1: To set up Cross Region Replication in AWS, firstly we need to designate a source bucket and a destination bucket. The source bucket contains the data that we want to replicate, while the destination bucket is where the replicated data will reside in another region.
I am creating the source bucket here which is in the Mumbai region.
Its created successfully as we can see below.
As this bucket is initially empty. Let’s upload some objects inside the source bucket.
Step2: Now we have to create another bucket i.e. the destination bucket. It should be in another region as we are performing cross region replication.
Don’t forget to enable bucket versioning for both source and destination buckets. Versioning allows S3 to keep track of different versions of objects, which is essential for replication.
Now, both buckets got created.
Step 3: We need to add replication rules in the configuration of the source bucket. In the source bucket, we will define a replication configuration that specifies the destination bucket and other replication settings. For this move to S3 source bucket > Management > Replication rules > Create Replication rule.
Mention here your destination bucket where the replicated data will reside in another region.
We need to create IAM roles with appropriate permissions to allow S3 to replicate data across regions. These roles should have permission to read objects from the source bucket and write objects to the destination bucket.
Click on Save.
It will ask your choice to replicate existing objects. Enter as per your need.
Step 4: As I am not replicating existing objects, I need to add now some newly updated objects in the source bucket. So, that it will get replicated in the destination bucket.
You can see below I have uploaded a new version of the log.txt file.
Now, It should get replicated on the destination bucket. Let’s see.
Yes, it’s now uploaded to the bucket in another region. This is how cross region replication works in S3.
We are all done now!!
Thanks for being with me till the end. In this blog, we all learned about how to set up S3 Cross Region Replication in AWS. If you liked this blog then please share it with your friends. If you still have any queries then contact me at Naincy.Kumari@Nashtechglobal.com.