This tutorial talked about how to transfer files from EC2 to S3.
- Login to your IAM dashboard, create a group with s3 full access permission.
- Create a user and assign to the group
Login to your ec2 instance, you need to configure aws with following command.
[[email protected] html]$ aws configure AWS Access Key ID [None]: XXXXXXXXXXXXXXXXXXX AWS Secret Access Key [None]: XXXXXXXXXXXXXXXXX Default region name [None]: enter Default output format [None]: enter
Test your connection
Test the following command to your S3 bucket and folder.
[[email protected] html]$ aws s3 ls s3://migratefolder/temp/ 2016-04-04 05:53:49 0 [[email protected] html]$
Now you can transfer file from your ec2 to s3.
[[email protected] html]$ aws s3 cp abc.tgz s3://migratefolder/temp/ upload: ./abc.tgz to s3://migratefolder/temp/abc.tgz
Download file from S3 to Ec2
Repeat the aws configure step, and download the file with corresponse command.
[[email protected] html]$ aws s3 cp s3://migratefolder/temp/abc.tgz abc.tgz