Transfer of Data Across Accounts from S3 to S3 Using AWS DataSync

GargeeBhatnagar - Sep 20 - - Dev Community

“ I have checked the documents of AWS to transfer the data between an s3 bucket across accounts. AWS Datasync service makes easy and secure transfer of data from s3 to s3. In terms of cost, the solution is cheaper and secure.”

AWS DataSync is an online data movement and discovery service that simplifies data migration and helps you quickly, securely and easily transfer your file or object data to, from and between AWS storage services.

In this post, you will experience the transfer of data across accounts from s3 to s3 using aws datasync. Here I have created a s3 bucket, iam role, cloudwatch log group and datasync across accounts.

Architecture Overview

Image description
The architecture diagram shows the overall deployment architecture with data flow, two aws accounts, s3 bucket, iam role, cloudwatch log group and aws datasync.

Solution overview

The blog post consists of the following phases:

  1. In Destination Account, Create a S3 Bucket with Required Bucket Policy and Permission
  2. In Source Account, Create a Service Role with Destination Bucket Permission and Create of Task for Source Location and Destination Location
  3. Output of Task Run as Data in Destination Bucket

Phase 1: In Destination Account, Create a S3 Bucket with Required Bucket Policy and Permission

  1. Open the s3 bucket console, create a s3 bucket. Set a bucket policy with source account role created in below steps with this bucket arn. Also set object ownership on the bucket.

Image description

Image description

Image description

Phase 2: In Source Account, Create a Service Role with Destination Bucket Permission and Create of Task for Source Location and Destination Location

  1. Open the IAM console, Create a service role for datasync with required permissions for destination bucket. Also create a task for data transfer as in sync from source to destination location.

Image description

Image description

Image description

Image description

Image description

Image description

Image description

Image description

Image description

Image description

Image description

Image description

Image description

Image description

Image description

Image description

Image description

Image description

Image description

Image description

Image description

Image description

Image description

Phase 3: Output of Task Run as Data in Destination Bucket

Image description

Image description

Image description

Image description

Image description

Image description

Image description

Image description

Image description

Image description

Clean-up

In Source Account : S3 bucket, IAM role, Datasync, Cloudwatch log group. In Destination Account : S3 bucket.

Pricing

I review the pricing and estimated cost of this example.

Cost of Simple Storage Service = $0.02

Cost of Cloudwatch = $0.0

Cost of DataTransfer = $0.0

Cost of AWS DataSync (DataSync fee for data copied) $0.0125 per GB = $(1.373 x 0.0125) = $0.02

Total Cost = $0.04

Summary

In this post, I showed “how to transfer of data across accounts from s3 to s3 using aws datasync”.

For more details on AWS DataSync, Checkout Get started AWS DataSync, open the AWS DataSync console. To learn more, read the AWS DataSync documentation.

Thanks for reading!

Connect with me: Linkedin
Image description

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .