Skip to content

S3 Cross Region Replication Audit & Setup

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

Output of the S3 replication script's header in the terminal window.
Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.