DEV Community

GargeeBhatnagar for AWS Community Builders

Posted on

5

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

“ 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

Billboard image

Monitor more than uptime.

With Checkly, you can use Playwright tests and Javascript to monitor end-to-end scenarios in your NextJS, Astro, Remix, or other application.

Get started now!

Top comments (0)

Best Practices for Running  Container WordPress on AWS (ECS, EFS, RDS, ELB) using CDK cover image

Best Practices for Running Container WordPress on AWS (ECS, EFS, RDS, ELB) using CDK

This post discusses the process of migrating a growing WordPress eShop business to AWS using AWS CDK for an easily scalable, high availability architecture. The detailed structure encompasses several pillars: Compute, Storage, Database, Cache, CDN, DNS, Security, and Backup.

Read full post

👋 Kindness is contagious

Dive into an ocean of knowledge with this thought-provoking post, revered deeply within the supportive DEV Community. Developers of all levels are welcome to join and enhance our collective intelligence.

Saying a simple "thank you" can brighten someone's day. Share your gratitude in the comments below!

On DEV, sharing ideas eases our path and fortifies our community connections. Found this helpful? Sending a quick thanks to the author can be profoundly valued.

Okay