AWS- CLI Service access

CLI Amazon Services Access

//How to access S3 using Command line
create ec2 of Amazon AMI(Amazon ami have preconfigured cli)
apt-get install awscli
//TRY command
aws
aws s3
aws s3 ls
aws s3 help

//will work only after configuration
image 1

open config file 

nano config
update config  using s3 credentials

image 2

//Back to root directory

image 3

//Now  to list buckets aws
//# aws s3 ls

//Assignment

// Transfer Data from s3 object to ec2 instance directory and vice versa
Note: give s3_access role to ec2 instance
(role cannot be assigned after instance is created)
(cannot add or change role of existing instance)
(however u can change permission of role, already assigned to insatnce )

Example:
aws s3 ls  //Will show buckets

aashish  //is bucket

aws s3 ls s3://aashish //to see content in bucket
hello.txt

// create directory in ec2 name Aashish

mkdir Aashish

//To copy from hello.txt from s3 to Aashish ec2 directory

aws s3 cp s3://aashish Aashish --recursive


Reactions: