Set Up Cross-Region S3 Bucket Replication

Hanad
3 min readDec 14, 2022

--

Introduction

Amazon Simple Storage Service (Amazon S3) is an object storage service that offers industry-leading scalability, data availability, security, and performance. In this lab, we explore how to use Amazon S3 to automatically replicate any object stored in our S3 bucket to a different region on the other side of the country. This ensures our files remain accessible in any extreme scenario where data loss could possibly occur. By the end of this lab, the user will understand how to create S3 buckets and enable automatic replication to back up files in a different physical location.

Create an S3 Bucket and Enable Replication

  • In the AWS console, navigate to S3.
  • Copy the name of the lab-provided appconfigprod1 bucket.
  • Click Create bucket.
  • Set the following values:
  • Bucket name: Paste the name you copied, but replace appconfigprod1 with appconfigprod2.
  • AWS Region: Select US West (Oregon) us-west-2.
  • Under Copy settings from existing bucket, click Choose bucket.
  • Select the appconfigprod1 bucket.
  • Click Choose bucket.
  • Leave the rest of the settings as the defaults, and click Create bucket. If you receive a warning about system tags, you can safely ignore it.
  • Click the appconfigprod1 bucket to open it.
  • Click the Management tab.
  • In the Replication rules section, click Create replication rule.
  • Click Enable Bucket Versioning.
  • Set the following values:
  • Under Replication rule configuration, in Replication rule name, enter CrossRegion.
  • Under Source bucket, in Choose a rule scope, select Apply to all objects in the bucket.
  • Under Destination, set the following parameters:
  • Leave Choose a bucket in this account selected.
  • Click Browse S3.
  • Select the appconfigprod2 bucket.
  • Click Choose path.
  • Click Enable bucket versioning.
  • Under IAM role, click the dropdown menu under IAM role, and select Create new role.
  • Click Save.
  • When prompted with the Replicate existing objects? popup, choose No, do not replicate existing objects and click Submit.

Test Replication and Observe Results

  • Click the appconfigprod1 bucket link in the breadcrumb trail navigation at the top of the screen.
  • Click Upload.
  • Either drag a file to the window or click Add file to upload a file of your choice.
  • Click Upload.
  • Once the upload has succeeded, click Close in the top-right corner.
  • Click the Buckets link in the breadcrumb trail navigation at the top of the page.
  • Click the appconfigprod2 bucket to open it.
  • You should see the file you uploaded to appconfigprod1. If it isn’t there yet, refresh and wait a minute or two for it to appear.

--

--