AWS: Set UP Cross-Region S3 Bucket Replication

By | December 16, 2021


In several previous journals, I have discussed about AWS S3 (Simple Storage Service) and its features such as lifecycle management, encryption, versioning, and static web hosting. In this journal, I will discuss another AWS S3 feature, namely Replication where the data/objects that we store in a bucket can be replicated and stored in another bucket automatically.

Based on the documentation at this link, replication allows buckets containing data to be copied in more than one place automatically. Replica buckets can be placed in single-destination (one target/replica bucket) or multi-destination (more than one target/replica bucket) and for this multi-destination you can also configure whether you want the region location to be the same as the first bucket or not. no.

Well, in this journal I want to share about cross-region replication where the bucket region from the source will be distinguished from the region in the destination bucket.

Let’s try.

First, open the AWS Management Console.

Click the search field and type s3. Then select the top result.

Here I have created a bucket which is located in the US East region as shown in the following screenshot.

I will try to create a new bucket with a different region from the first bucket. For example, I select the US West region. And under the region options, in the Copy settings from existing bucket settings click Choose bucket.

Select the first previously created bucket.

The result when selected will be as follows. Why did I copy the configuration from the first bucket? make sure the configuration is the same.

Scroll down and click Create bucket.

Make sure the bucket is created successfully and the result is as follows. Seen there are two buckets that are in two different regions.

Click the first bucket in US East, then go to the Management tab. The replica configuration is in the Replication rules section and looks empty because we haven’t created any rules yet. To create one, click Create replication rule.

There will be a warning message where we need to enable the versioning feature when we want to configure the replication feature. Can you activate it first?

Beri nama untuk rule nya, misal CrossRegion dan atur statusnya menjadi Enabled.

Scroll down and for the source bucket, you can select the scope. Here I select This rule applies to all objects in the bucket, which means that all objects in the bucket will be replicated. In the Destinations section, click Browse S3 to select a destination.

For the destination bucket, select the second bucket, yes, the one in the US West.

Activate the versioning feature on the destination bucket too, when a warning appears, you can directly click Enable.

Scroll down and under IAM Role, select Create new role.

For other features leave the default, then click Save.

Wait a few moments until the replication configuration is successful.

When it’s OK, when we save data in the first bucket (US East), the data will be automatically replicated and stored in the second bucket (US West).

That’s it!

Leave a Reply

Your email address will not be published. Required fields are marked *