Replication Object multi Region

Amazon S3 Cross-Region Replication (CRR)

What is Cross-Region Replication?

Amazon S3 Cross-Region Replication (CRR) is a feature that automatically replicates objects across buckets in different AWS regions. This provides geographic redundancy and helps meet compliance requirements while improving data availability and disaster recovery capabilities.

Key Benefits

  • Disaster Recovery: Protect against regional outages and disasters
  • Compliance: Meet regulatory requirements for geographic data distribution
  • Latency Reduction: Serve content from regions closer to users
  • Data Sovereignty: Keep copies of data in specific geographic locations
  • Operational Excellence: Maintain business continuity across regions

How CRR Works

When CRR is configured:

  • Objects are automatically copied to destination buckets in different regions
  • Replication occurs asynchronously, typically within 15 minutes
  • Object metadata, ACLs, and tags are preserved during replication
  • Versioning must be enabled on both source and destination buckets
  • IAM roles provide necessary permissions for the replication process

AWS Well-Architected Framework

AWS Well-Architected helps you build secure, high-performing, resilient, and efficient infrastructure. Based on 6 main pillars, with the Reliability pillar being the focus of this lab.

To ensure the Reliability of the system, objects stored in the S3 bucket in Singapore Region (ap-southeast-1) should be replicated to another region for redundancy and disaster recovery.

Static website

Region Selection Criteria

When choosing a destination region for replication, consider these factors:

  • Compliance: Regulatory requirements for data location
  • Latency: Distance to end users for performance optimization
  • Cost: Data transfer and storage costs vary by region
  • Services and Features: Availability of required AWS services
  • Disaster Recovery: Geographic separation for risk mitigation

For this lab, we will select the destination region based primarily on cost optimization while maintaining adequate geographic separation.

  • -> So Region N. Virginia (us-east-1) with S3 cost: 23.55 USD for 1TB per month - 2.05 USD cheaper than Region Singapore (ap-southeast-1) is a suitable choice for the criteria Cost. You can double check the cost at the official page of AWS Pricing Calculator.

Static website

  1. Next, we will create a new bucket.

    • In the S3 bucket interface, select Create bucket.

    Static website

    • In the Bucket name field, type aws-first-cloud-ai-journey-xxxx-cross.

    Static website

    • Keep the default values, scroll to the bottom of the page, and select Create bucket.

    Static website

  2. Replicate files between Buckets in different Regions.

    • In the Amazon S3 interface, select bucket aws-first-cloud-ai-journey-1902. You must upload the data again as in step 2.2 (because the data was moved in step 9).

    Static website

    • Select Management.

    Static website

    • Scroll down to the middle of the page, select Create replication rule.

    Static website

    • In the Replication rule name section, enter PrimaryToSecondary.
    • In the Status section, select Enabled.
    • In the Choose a rule scope section, select Apply to all objects in the bucket.
    • In the Destination section, select Choose a bucket in this account.
      • Note: You can choose Specify a bucket in another account to copy data to a bucket belonging to another AWS account. However, within the framework of this lab, we just choose the solution of copying data to another bucket in the same AWS account.
    • In the Bucket name section, select Browse S3.

    Static website

    • Select bucket aws-first-cloud-ai-journey-1902-cross.

    Static website

    • Enable the versioning feature as required by Amazon S3.
    • Select Enable bucket versioning.

    Static website

    • In the IAM role section, select Create new role from the list of existing IAM roles.

    Static website

    • Keep the remaining default values and select Save.

    Static website

    • Select No, do not replicate existing objects.

    Static website

  3. Check S3 bucket aws-first-cloud-ai-journey-1902-cross.

    • In the S3 bucket aws-first-cloud-ai-journey-1902-cross interface in region N. Virginia, check if there are any objects yet.

    Static website

  4. Upload new file to S3 bucket aws-first-cloud-ai-journey-1902.

    • At the S3 bucket interface aws-first-cloud-ai-journey-1902, select Upload.

    • Select the images folder and upload any photo.

    Static website

    • After the upload is complete, select Close.

    Static website

  5. Check the Replication feature.

    • In the S3 interface, select bucket aws-first-cloud-ai-journey-1902-cross in region N. Virginia.

    Static website

    • Check Object.

    Static website

    • If the Object has not appeared, please be patient for a few minutes and refresh the page.

    Static website

    • Result:

    Static website

    • The image file uploaded to S3 bucket aws-first-cloud-ai-journey-1902 in step 4 has now appeared in bucket aws-first-cloud-ai-journey-1902-cross.

    • => You have completed the object replication lab between S3 buckets in 2 different Regions.