S3 sync commands

--

EC2 to S3 access

Method1: via Access Key and Secret Key

check if aws cli is available at ec2: aws s3 ls
if needed : pip install awscli

aws configure

AWSAccessKeyId=<>
AWSSecretKey=<>
region: us-east-1

Method2: via IAM role

create a new role: EC2toS3

attach: AmazonS3fullaccess policy

attach this role to EC2 (security)

perform CLI operations:

--Create new bucket
aws s3 mb s3://<bucket-name>
--list objects of a bucket
aws s3 ls s3://bucket-name
--remove a bucket
aws s3 rb s3://bucket-name
--sync content to s3 from local/ec2
aws s3 sync . s3://<bucket-name>
--sync from s3 to ec2
aws s3 sync s3://<bucket-name> .

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

--

--

Dipali Kulshrestha
Dipali Kulshrestha

No responses yet

Write a response