How do I do an S3 copy between regions using aws cli?

Solx picture Solx · Jan 28, 2016 · Viewed 15.9k times · Source

It was far to difficult to figure this out. It wasn't obvious to me and lots of explanations left out key details. I will answer this with the solution. Sorry if it seems obvious to you, but given how many searches and experiments it took me to do this, I think it is quite worthwhile to show others how to do it.

Answer

Solx picture Solx · Jan 28, 2016

The trick is being explicit about both the source and destination regions. They might not always be required, but it doesn't hurt to always show them:

$ aws s3 cp s3://my-source-bucket-in-us-west-2/ \
      s3://my-target-bucket-in-us-east-1/ \
      --recursive --source-region us-west-2 --region us-east-1

Or on Windows

> aws s3 cp s3://my-source-bucket-in-us-west-2/ ^
          s3://my-target-bucket-in-us-east-1/ ^
          --recursive --source-region us-west-2 --region us-east-1