AWS S3 Cross-Account Replication

Cagrihankara
3 min readJan 7, 2023

S3 Cross Account Replication refers to copying the contents of the S3 bucket from one account to another S3 bucket in a different account. Its possible that both the accounts may or may not be owned by the same individual or organization.

Prerequisites

1. Create the following S3 buckets in their respective account:

“source-bucket” in AWS account A

“destination bucket” in AWS account B

2. All the buckets — source and destination should have ‘Bucket Versioning’ enabled (This can be set at the time of bucket creation)

Replication Steps

  1. In the source bucket we will create a Replication Rule on Bucket Management tab with the following settings:

2. You should update source bucket policy:

This policy allows the destination bucket in account B to list and get objects from the source bucket in account A.

3. Create a role for cross account replication in the source account

  • Navigate to IAM console in the ‘Data’ account (Account A)
  • Create a policy. Allows to list and get objects from source and destination buckets. Provide a name to the policy (say ‘cross-account-bucket-replication-policy’) and add policy contents based on the below syntax:

4. You should update destination bucket policy:

5. If we look at two buckets after replication;

Bucket in source bucket (account A):

Bucket in destination bucket (account B):

Thank you so much for reading this article, I hope it has helped simplify the process of your case.

If you have any questions, please feel free to drop a comment or to write me on LinkedIn, and I’ll be happy to answer it for you.

If this article helped you out I’d appreciate you letting me know with a few claps or a follow on Medium, thank you.

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

No responses yet

Write a response