Copy S3 bucket objects across AWS accounts

Parag Poddar
Aug 6, 2018 · 2 min read

In this blog, I am going to explain about, how to transfer S3 objects from one AWS account to another.

Prerequisites

  • Create an IAM user in destination AWS account (see this doc to create IAM user for AWS account).
  • Configure AWS CLI in local machine with previously created IAM user credentials (see this doc to configure AWS CLI).

Step 1: Get the 12 digit destination AWS account number

Step 2: Setup source S3 bucket

Step 3: Setup destination S3 bucket

Step 4: Attach policy to IAM user in destination AWS account

Step 5: Sync S3 objects to destination

aws s3 sync s3://SOURCE-BUCKET-NAME s3://DESTINATION-BUCKET-NAME --source-region SOURCE-REGION-NAME --region DESTINATION-REGION-NAME

The above command should be executed with destination AWS IAM user account credentials only otherwise the copied objects in destination S3 bucket will still have the source account permissions and won’t be accessible by destination account users.

Conclusion

Tensult Blogs

Stories on Cloud computing, Analytics, Automation and Security

Parag Poddar

Written by

Tensult Blogs

Stories on Cloud computing, Analytics, Automation and Security