Skip to content

Transferring Files Across AWS S3 Buckets in Different AWS Accounts Using Scripting

Notifications You must be signed in to change notification settings

sagar-18/s3-devops-assignment

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 

Repository files navigation

s3-devops-assignment

Transferring Files Across AWS S3 Buckets in Different AWS Accounts Using Scripting

Step 1: Create source AWS Account (name: “AS”) and S3 Bucket (name: “same-cb-bucket-sagar” )

Screenshot 2023-07-30 at 8 03 51 PM

Step 2: Create destination AWS Account (DG) and S3 Bucket (name: “same-cb-bucket-sagar-dest”)

Screenshot 2023-07-30 at 8 04 21 PM

Step 3: Configure IAM Roles (name: “s3-role-cb-src-as”) and Policies (name: “s3-cb-policy-lambda-sagar”) in the source AWS account.

Screenshot 2023-07-30 at 8 05 16 PM Screenshot 2023-07-30 at 8 25 29 PM

Step 4: Create Lambda Function (name: “s3-cb-lmbda”) and add the S3 trigger in the Source AWS account.

Screenshot 2023-07-30 at 8 25 56 PM

Code Used (NodeJs and Also Python boto3):

Screenshot 2023-07-30 at 8 26 12 PM Screenshot 2023-07-30 at 8 26 24 PM Screenshot 2023-07-30 at 8 26 37 PM

Python:

Screenshot 2023-07-30 at 8 26 59 PM

Step 5: Add Bucket Policy in the destination S3 Bucket (name: “same-cb-bucket-sagar-dest”):

Screenshot 2023-07-30 at 8 27 19 PM

Step 6: Test the Function by uploading any file to source AWS bucket: File to be uploaded: leadsquared.png

Screenshot 2023-07-30 at 8 27 45 PM

Step 7: Now verify in the destination bucket.

Screenshot 2023-07-30 at 8 28 09 PM

Conclusion:

In this assignment, we transferred S3 bucket data from a source AWS account to a destination AWS account's S3 bucket using a Lambda trigger function. The process involved: ● Setting up the necessary AWS resources. ● Configuring IAM roles and policies. ● Creating a Lambda function. ● Testing the functionality.

This assignment has provided hands-on experience working with AWS services, IAM roles, Lambda functions, and S3 buckets. It has showcased the power and flexibility of AWS to automate data transfer tasks and securely manage resources across different AWS accounts.

About

Transferring Files Across AWS S3 Buckets in Different AWS Accounts Using Scripting

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published