- Building Serverless Web Applications
- Diego Zanon
- 146字
- 2021-07-15 17:31:29
Using S3 with the CLI
The Management Console is very useful to upload and download files from S3, but so is the CLI. Let's play with the CLI in this section to gain more familiarity. We will create a bucket and store a file by performing the following steps. Those will be useful later for the AWS Lambda demo:
- First, choose a bucket name and use the make-bucket command:
aws s3 mb s3://my-bucket-name
- Now, create a file named test.txt and write something to it.
- Copy the file to your new bucket setting the Access Control List (ACL) as public content:
aws s3 cp test.txt s3://my-bucket-name/ --acl public-read
- List the bucket contents using the following command line:
aws s3 ls s3://my-bucket-name
- Download the file as test2.txt by using the following command line:
aws s3 cp s3://my-bucket-name/test.txt test2.txt
For more commands, refer to the official guide at http://docs.aws.amazon.com/cli/latest/userguide/using-s3-commands.html.
推薦閱讀
- Boost程序庫完全開發指南:深入C++”準”標準庫(第5版)
- Microsoft Exchange Server PowerShell Cookbook(Third Edition)
- GeoServer Cookbook
- Testing with JUnit
- 無代碼編程:用云表搭建企業數字化管理平臺
- MongoDB for Java Developers
- 編寫整潔的Python代碼(第2版)
- 你不知道的JavaScript(中卷)
- 實戰Java高并發程序設計(第3版)
- Yocto for Raspberry Pi
- MATLAB for Machine Learning
- UVM實戰
- Android系統級深入開發
- C++寶典
- Statistical Application Development with R and Python(Second Edition)