Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

AWS Synchronize S3 bucket with EC2 instance

I would like to synchronize an S3 bucket with a single directory on multiple Windows EC2 instances. When a file is uploaded or deleted from the bucket, I would like it to be immediately pushed or removed respectively from all of the instances. New instances will be added/removed frequently (multiple times per week). Files will be uploaded/deleted frequently as well. The files sizes could be up to 2gb in size. What AWS services or features can solve this?

like image 964
Preston Martin Avatar asked Mar 27 '26 02:03

Preston Martin


1 Answers

Based on what you've described, I'd propose the following solution to this problem.

You need to create an SNS topic for S3 change notifications. Then you need a script that's going to subscribe to this topic from your machines. This script will update files on your machines based on changes coming from S3. It should support basic CRUD operations.

Run this script and then sync contents of your S3 to your machine when it starts using aws-cli mentioned above.

like image 169
adamkonrad Avatar answered Apr 01 '26 07:04

adamkonrad



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!