Skip to content

Instantly share code, notes, and snippets.

@LucasKuhn
Created August 19, 2020 14:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save LucasKuhn/c9fd37f48bd4bbedb51f62834dd1cb28 to your computer and use it in GitHub Desktop.
Save LucasKuhn/c9fd37f48bd4bbedb51f62834dd1cb28 to your computer and use it in GitHub Desktop.
Copy a S3 bucket from different owners using only API_KEYS
  1. Copy the origin S3 bucket to a local temp folder using the origin key:
AWS_ACCESS_KEY_ID=<key-here> AWS_SECRET_ACCESS_KEY=<secret-here> aws s3 sync s3://origin-bucket-name temp
  1. Copy from your local temp folder to the destination bucket, using the destination key:
AWS_ACCESS_KEY_ID=<key-here> AWS_SECRET_ACCESS_KEY=<secret-here> aws s3 sync temp s3://destination-bucket-name
  1. Delete the local temp folder
rm -rf ./temp 
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment