amazon-s3aws-lambdaaws-clieventtriggeraws-datasync

S3 to S3 Cross account data replication


I have a S3 bucket in Account A and i want to replicate it to S3 bucket in Account B. I need the whole process along with security measures explained in detail. Starting from how to setup the whole process with VPC and this needs to happen whenever new data is uploaded into S3 bucket in Account A. Deletion in Account A should not be replicated in Account B. I need this for folder and subfolder level as well. I need the cost explanation as well if possible.


Solution

  • You should use Amazon S3 Replication, which can be performed in the same region or between regions, including for buckets belonging to different different AWS Accounts.

    See:

    You will need to add a Bucket Policy to the destination bucket to permit access from the source bucket's AWS Account.

    See: Configuring replication when source and destination buckets are owned by different accounts - Amazon Simple Storage Service

    You can control the source Bucket and Prefix (folder) and the destination Bucket. Replication is managed by the Amazon S3 service, there is no need for you to change "S3 Block Public Access" settings.

    If the source and destination buckets are in different Regions, then Data Transfer costs will apply.