Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save akshaymohite/a084781f0cbac6d4ceef051f1c056326 to your computer and use it in GitHub Desktop.
Save akshaymohite/a084781f0cbac6d4ceef051f1c056326 to your computer and use it in GitHub Desktop.
How to transfer AWS s3 resources from one account to other AWS s3 account?

Transfer AWS s3 resources from one account to other AWS s3 account

Step 1: Get Security Credentials

Get your AWS account Security Credentials.

Alt text

Obtain AWS_SECRET_KEY and AWS_ACCESS_KEY from the security page. We can find it here or you can generate a new one.

Alt text

Step 2: Install AWS CLI

Easiest way to install aws cli is using Homebrew using command -

brew install awscli

Step 3: Configure AWS CLI

Configure AWS CLI with the following command,

aws configure

It will prompt you following details. Use the credentials obtained in the Step 1.

AWS Access Key ID : XXXXXXXXXXXXXXXXXXXX
AWS Secret Access Key : XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Default region name [us-east-1]: us-east-1
Default output format [json]: json

Step 4:

To Sync particular bucket content to your current folder use the following command:

aws s3 sync s3://your-bucket-name .

This will sync the bucket contents in your current folder.

Thanks for Reading, Hope you found this helpful!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment