AWS S3
- By the aws console (Not recommended, but intuitive and simple)
See Steps blew
- By the aws cli (Recommended, support large files and intermittent transfer, fast speed)
1. Install AWS CLI
If the AWS CLI is not installed on your EC2 instance, follow these steps to install it.
# For Amazon Linux or CentOS
sudo yum install aws-cli -y
# For Ubuntu
sudo apt-get update
sudo apt-get install awscli -y
2. Configure AWS CLI
Use the following command to configure the AWS CLI, entering your AWS access key and region information.
aws configure
You will need to provide the following information:
AWS Access Key ID
AWS Secret Access Key
Default region name (e.g. ap-southeast-1)
Default output format (you can choose json)
3. Sync Files
Use the aws s3 sync
command to synchronize files from the S3 bucket to your EC2 instance.
Example:Assuming you want to sync files from CHENGDU80 topic S3 bucket named chengdu80-topic to the /home/ec2-user/myfiles
directory on your EC2 instance, you would run:
aws s3 sync s3://fintech80chengdu-topic /your-local-folder --region ap-east-1
4. Verify Sync
After synchronization is complete, you can use the ls
command to check the target directory and confirm that files have been successfully downloaded.
ls /home/ec2-user/myfiles
By the aws console (Not recommended, but intuitive and simple)Uploading an object to a bucket
Amazon S3 managerment Console
In the Bucket list, choose the name of the bucket that you want to upload your object to.
On the Overview tab for your bucket, choose Upload or Get Started.
To choose the file to upload, in the Upload dialog box, choose Add files.
Click the Upload button to finish uploading.
You've successfully uploaded an object to your bucket.
Delecting an object
Amazon S3 managerment Console
In the Buckets list, choose the name of the bucket that you want to delete an object from.
In the Name list, select the check box for the object that you want to delete,and then choose Delete.
In the Delete objects dialog box, verify the name of the object, and type permanently delete.
Click the Delete objects button to complete the deletion
You've successfully deleted an object to your bucket.
Downloading an object from a bucket
Amazon S3 managerment Console
In the Buckets list, choose the name of the bucket that you want to download an object from.
In the Name list, select the check box for the object that you want to download.
Click the Download button to start the download task.
You've successfully downloaded an object to your bucket.
Last updated