I’ve been working on bringing the infrastructure on one of my AWS projects up to it’s security hardened standard. One of the tasks was to set up cross-region replication on the S3 buckets.
Today I’m publishing the Bash script I used to do this. Running the s3-crr-script.sh script will:
- Iterate through the buckets in the specified source region and then:
- Enable Object Versioning if it’s not already enabled
- Create a new S3 bucket (if needed) in the destination region with a
-replica(customizable) suffix. - Configure replication between the two buckets
This was much faster than doing each bucket individually!
The script is available here, on GitHub:
https://github.com/shawnhooper/s3-crr-script

