S3 cross-region replication between Accounts

Share This:
AWS Logo

S3 cross account replication helps us to keep backup of our data, with versioning enabled. This will give us some breathe when any DR happens or the data we lost it.

In this tutorial we will configure how to do s3 cross region replication between two accounts.

prerequisites :

One bucket in Source region/account One bucket in Destination region/accountVersioning enabled

Once the bucket is created in S3. Click on the Management tab and choose

Replication(Source Account)

S3 Replication

and Click on Add rule

1)Source

I am currently moving all the contents inside the bucket.

If you want move the content inside a folder

choose prefix in this bucket and add the folder name like below

eg : test/

Click Next

2) Destination

Click on choose a bucket and select Buckets in another account.

Enter the Destination Account ID and the Destination bucket name

click save.

S3 Replication Rule

3) Pemissions

Choose create a New role (the role will be created )

copy the bucket policy(this policy should be placed in the destination bucket policy-(destination account))

Policy will be look like this.Copy and paste it in your destination bucket.

{
"Version": "2008-10-17",
"Id": "S3-Console-Replication-Policy",
"Statement": [
{
"Sid": "S3ReplicationPolicyStmt1",
"Effect": "Allow",
"Principal": {
"AWS": "arn:aws:iam::AWSACCOUNTID:root"
},
"Action": [
"s3:GetBucketVersioning",
"s3:PutBucketVersioning",
"s3:ReplicateObject",
"s3:ReplicateDelete"
],
"Resource": [
"arn:aws:s3:::BucketName",
"arn:aws:s3:::BucketName/*"
]
}
]
}

4) Review and Click on Save to enable the replication.

Changes in Destination Account :

  1. Click on the destination bucket
  2. Click on the permission. Select the bucket policy and paste the policy generated in the source account.
  3. Click on Management. Choose Replication and click More and select Recieve objects.
S3 Replication Destination

Enter the Source account ID and click Done.

S3 Source Account ID

Upload Files to the source bucket

Uploading Files to Source Bucket

Check the files in the Destination Bucket. The files are replicated from Source account to Destination account.

Replication Completed
Share This:

Popular on WPSteam Right Now!

Leave a Reply

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

Subscribe to Blog via Email

Enter your email address to subscribe to this blog and receive notifications of new posts by email.

Join 22 other subscribers

I need help with...

Subscribe to Blog via Email

Enter your email address to subscribe to this blog and receive notifications of new posts by email.

Join 22 other subscribers

I need help with...