- Newest
- Most votes
- Most comments
With S3 replication you cannot specify destination bucket's prefix. You can only choose the bucket in any region/account and then replication itself will create the prefix in destination bucket.
If you need objects to be replicated/copy/sync into different prefixes in destination bucket then viable options are :
- DataSync, it will allow you to select prefix at destination bucket and can perform copy based on your job schedule (Pls note as it is a copy event, object's time stamp will change, this solution has higher cost compare to replication and its not real time but less management overhead)
- Create lambda function to copy objects based on S3 PUT object event, in that function you can define the rules & condition to copy objects to any prefix, this will be more cost affective than Datasync.
I presented a demo of both the solutions to a CX few months ago.
Hi Narravula,
Thanks for your reply. I am able to find the prefix for source while setting the replication rule, whereas I do not find the prefix for destination. Am i missing anything here ?
Regards, Rajendra
Hello Rajendra,
Have you explored AWS DataSync for this use-case? Using DataSync, you can copy data between two S3 buckets across accounts, regions, partitions with few clicks and no scripting/coding is required.
With AWS DataSync you can copy data from a prefix in source S3 bucket to another prefix in destination S3 bucket depending on how you configure the DataSync task.
Here is the tutorial that walks you through how to do that: https://docs.aws.amazon.com/datasync/latest/userguide/tutorial_s3-s3-cross-account-transfer.html
Relevant content
- asked 5 months ago
- AWS OFFICIALUpdated 8 months ago
- AWS OFFICIALUpdated a year ago
- AWS OFFICIALUpdated a year ago
- AWS OFFICIALUpdated a year ago
You're absolutely right. The destination prefix is not always as explicitly visible as the source prefix when configuring replication rules in the AWS Management Console.
breakdown of how to locate and set the destination prefix: