aws s3 cli
It is the second article in the Learn AWS CLI series. It gives you an overview of working with the AWS S3 bucket using CLI commands. We also look at a brief overview of the S3 bucket and its key components.
这是Learn AWS CLI系列文章中的第二篇。 它概述了如何使用CLI命令使用AWS S3存储桶。 我们还将简要介绍S3存储桶及其关键组件。
先决条件 (Prerequisites)
You should meet the following prerequisites before going through exercises demonstrated in this article.
在进行本文演示的练习之前,您应该满足以下先决条件。
- Created an Amazon web console 创建了一个Amazon Web控制台
- IAM user with relevant access. You can use a root account as well, but it has the highest permissions, and you should avoid using root user in a production environment 具有相关访问权限的IAM用户。 您也可以使用root帐户,但是它具有最高的权限,因此应避免在生产环境中使用root用户。
- Installed AWS CLI in either local system or AWS EC2 machine 在本地系统或AWS EC2计算机中安装的AWS CLI
- Learn AWS CLI – An Overview of AWS CLI (AWS Command Line Interface) for more details 学习AWS CLI – AWS CLI概述(AWS命令行界面) 。
AWS S3存储桶概述 (Overview of AWS S3 Bucket)
Amazon Web Services (AWS) provide a cloud storage service to store and retrieves files. It is known as Simple Storage Service or AWS S3. You might be familiar with Dropbox or Google Drive for storing images, docs, and text files in the cloud. AWS S3 is a similar kind of service from Amazon. You can store a single file up to 5 TB with unlimited storage. It provides benefits such as flexibility, scalability, durability, Availability.
Amazon Web Services(AWS)提供了一种云存储服务来存储和检索文件。 它称为简单存储服务或AWS S3。 您可能对Dropbox或Google云端硬盘在云中存储图像,文档和文本文件很熟悉。 AWS S3是亚马逊提供的类似服务。 您最多可以存储5 TB的单个文件,而不受限制。 它提供了诸如灵活性,可伸缩性,耐用性,可用性等优点。
Log in to the AWS Console using either root account or IAM user and then expand Services. You can see S3 listed in the Storage group as shown below.
使用root帐户或IAM用户登录到AWS控制台,然后展开Services 。 您可以在存储组中看到S3,如下所示。
Click on S3, and it launches the S3 console. Here, you see an existing bucket (if any) and options to create a new bucket.
单击S3,它将启动S3控制台。 在这里,您会看到现有的存储桶(如果有)以及创建新存储桶的选项。
- Bucket: A bucket is a container or a folder to store the objects. We can have sub-folders in a folder. You must create a unique namespace for an S3 bucket. We cannot use the upper case or space in the bucket name. We can go through the 存储桶:存储桶是用于存储对象的容器或文件夹。 我们可以在文件夹中包含子文件夹。 您必须为S3存储桶创建唯一的名称空间。 我们不能在存储桶名称中使用大写字母或空格。 我们可以浏览article to view naming conventions in an S3 bucket 本文以查看S3存储桶中的命名约定
- Key: Each object name is a key in the S3 bucket 密钥:每个对象名称都是S3存储桶中的一个密钥
- Metadata: S3 bucket also stores the metadata information for a key such as a file upload timestamp, last update timestamp, version 元数据: S3存储桶还存储密钥的元数据信息,例如文件上传时间戳,最近更新时间戳,版本
Object URL: Once we upload any object in the AWS S3 bucket, it gets a unique URL for the object. You can use this URL to access the document. This URL is in the following format:
对象URL:将任何对象上传到AWS S3存储桶后,它将获得该对象的唯一URL。 您可以使用此URL访问文档。 该URL的格式如下:
https://[BucketName].[Region].[amazonaws.com]/object key.file_extension
https:// [BucketName]。