Skip to content

Instantly share code, notes, and snippets.

@ericpardee
Last active September 8, 2020 04:29
Show Gist options
  • Save ericpardee/ff3cdde1b25c3fc09b7a888d4cb65ab5 to your computer and use it in GitHub Desktop.
Save ericpardee/ff3cdde1b25c3fc09b7a888d4cb65ab5 to your computer and use it in GitHub Desktop.
How can I migrate my Amazon S3 bucket to another AWS Region?

You can't move an Amazon Simple Storage Service (Amazon S3) bucket to another AWS Region

But once you follow all these instructions, and sync your buckets aws s3 sync s3://wrongregion-bestbucketever s3://bestbucketever-temp --source-region us-west-1 --region us-west-2 it says

To claim the bucket name as soon as it's available, you can run a script to continuously check the bucket name's availability.

That script is this (I didn't just issue the CreateBucket API call because my situation is more involved):

buckYeah() { if aws s3api wait bucket-exists --bucket bestbucketever ; then echo "Terraform Time" | mail -s "Bucket Ready" [email protected] ; else buckYeah ; fi ; } ; buckYeah
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment