官术网_书友最值得收藏!

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:

  1. First, choose a bucket name and use the make-bucket command:
        aws s3 mb s3://my-bucket-name
  1. Now, create a file named test.txt and write something to it.
  2. 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
  1. List the bucket contents using the following command line:
        aws s3 ls s3://my-bucket-name
  1. 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.
主站蜘蛛池模板: 凌源市| 元谋县| 广水市| 长沙县| 平阴县| 云和县| 抚州市| 东明县| 吕梁市| 黔西| 罗甸县| 荆门市| 正镶白旗| 北京市| 通河县| 丘北县| 青冈县| 类乌齐县| 南澳县| 平乡县| 云龙县| 观塘区| 漳浦县| 廉江市| 西贡区| 孟连| 明溪县| 富宁县| 阳城县| 古浪县| 磴口县| 遂昌县| 闽侯县| 秀山| 封丘县| 潼南县| 三河市| 页游| 穆棱市| 富阳市| 南郑县|