s3cmd,boto和AWS CLI之间的区别

时间:2022-11-18 23:04:16

I am thinking about redeploying my static website to Amazon S3. I need to automate the deployment so I was looking for an API for such tasks. I'm a bit confused over the different options.

我正在考虑将我的静态网站重新部署到Amazon S3。我需要自动部署,所以我一直在为这些任务寻找API。我对不同的选择感到有点困惑。

Question: What is the difference between s3cmd, the Python library boto and AWS CLI?

问题:s3cmd,Python库boto和AWS CLI之间有什么区别?

1 个解决方案

#1


36  

s3cmd and AWS CLI are both command line tools. They're well suited if you want to script your deployment through shell scripting (e.g. bash).

s3cmd和AWS CLI都是命令行工具。如果您想通过shell脚本(例如bash)编写部署脚本,它们非常适合。

AWS CLI gives you simple file-copying abilities through the "s3" command, which should be enough to deploy a static website to an S3 bucket. It also has some small advantages such as being pre-installed on Amazon Linux, if that was where you were working from (it's also easily installable through pip).

AWS CLI通过“s3”命令为您提供简单的文件复制功能,这足以将静态网站部署到S3存储桶。它还有一些小的优点,例如预先安装在Amazon Linux上,如果你正在使用它(它也可以通过pip轻松安装)。

One AWS CLI command that may be appropriate to sync a local directory to an S3 bucket:

一个AWS CLI命令,可能适合将本地目录同步到S3存储桶:

$ aws s3 sync . s3://mybucket

Full documentation on this command: http://docs.aws.amazon.com/cli/latest/reference/s3/sync.html

有关此命令的完整文档:http://docs.aws.amazon.com/cli/latest/reference/s3/sync.html

Edit: As mentioned by @simon-buchan in a comment, the aws s3api command gives you access to the complete S3 API, but its interface is more "raw".

编辑:正如@ simon-buchan在评论中所提到的,aws s3api命令可以让您访问完整的S3 API,但它的界面更“原始”。

s3cmd supports everything AWS CLI does, plus adds some more extended functionality on top, although I'm not sure you would require any of it for your purposes. You can see all its commands here: http://s3tools.org/usage

s3cmd支持AWS CLI所做的一切,并且在顶部添加了一些更多的扩展功能,但我不确定您是否需要它们用于您的目的。您可以在此处查看其所有命令:http://s3tools.org/usage

Installation of s3cmd may be a bit more involved because it doesn't seem to be packages for it in any distros main repos.

安装s3cmd可能会涉及更多,因为在任何发行版主要回购中它似乎都不是它的包装。

boto is a Python library, and in fact the official AWS Python SDK. The AWS CLI, also being written in Python, actually uses part of the boto library (botocore). It would be well suited only if you were writing your deployment scripts in Python. There are official SDKs for other popular languages (Java, PHP, etc.) should you prefer: http://aws.amazon.com/tools/

boto是一个Python库,实际上是官方的AWS Python SDK。 AWS CLI也是用Python编写的,实际上使用了boto库的一部分(botocore)。只有在用Python编写部署脚本时才适用。如果您愿意,可以使用其他流行语言(Java,PHP等)的官方SDK:http://aws.amazon.com/tools/

The rawest form of access to S3 is through AWS's REST API. Everything else is built upon it at some point. If you feel adventurous, here's the S3 REST API documentation: http://docs.aws.amazon.com/AmazonS3/latest/API/APIRest.html

对S3的最新访问形式是通过AWS的REST API。在某些时候,其他一切都建立在它之上。如果你喜欢冒险,那么这里是S3 REST API文档:http://docs.aws.amazon.com/AmazonS3/latest/API/APIRest.html

#1


36  

s3cmd and AWS CLI are both command line tools. They're well suited if you want to script your deployment through shell scripting (e.g. bash).

s3cmd和AWS CLI都是命令行工具。如果您想通过shell脚本(例如bash)编写部署脚本,它们非常适合。

AWS CLI gives you simple file-copying abilities through the "s3" command, which should be enough to deploy a static website to an S3 bucket. It also has some small advantages such as being pre-installed on Amazon Linux, if that was where you were working from (it's also easily installable through pip).

AWS CLI通过“s3”命令为您提供简单的文件复制功能,这足以将静态网站部署到S3存储桶。它还有一些小的优点,例如预先安装在Amazon Linux上,如果你正在使用它(它也可以通过pip轻松安装)。

One AWS CLI command that may be appropriate to sync a local directory to an S3 bucket:

一个AWS CLI命令,可能适合将本地目录同步到S3存储桶:

$ aws s3 sync . s3://mybucket

Full documentation on this command: http://docs.aws.amazon.com/cli/latest/reference/s3/sync.html

有关此命令的完整文档:http://docs.aws.amazon.com/cli/latest/reference/s3/sync.html

Edit: As mentioned by @simon-buchan in a comment, the aws s3api command gives you access to the complete S3 API, but its interface is more "raw".

编辑:正如@ simon-buchan在评论中所提到的,aws s3api命令可以让您访问完整的S3 API,但它的界面更“原始”。

s3cmd supports everything AWS CLI does, plus adds some more extended functionality on top, although I'm not sure you would require any of it for your purposes. You can see all its commands here: http://s3tools.org/usage

s3cmd支持AWS CLI所做的一切,并且在顶部添加了一些更多的扩展功能,但我不确定您是否需要它们用于您的目的。您可以在此处查看其所有命令:http://s3tools.org/usage

Installation of s3cmd may be a bit more involved because it doesn't seem to be packages for it in any distros main repos.

安装s3cmd可能会涉及更多,因为在任何发行版主要回购中它似乎都不是它的包装。

boto is a Python library, and in fact the official AWS Python SDK. The AWS CLI, also being written in Python, actually uses part of the boto library (botocore). It would be well suited only if you were writing your deployment scripts in Python. There are official SDKs for other popular languages (Java, PHP, etc.) should you prefer: http://aws.amazon.com/tools/

boto是一个Python库,实际上是官方的AWS Python SDK。 AWS CLI也是用Python编写的,实际上使用了boto库的一部分(botocore)。只有在用Python编写部署脚本时才适用。如果您愿意,可以使用其他流行语言(Java,PHP等)的官方SDK:http://aws.amazon.com/tools/

The rawest form of access to S3 is through AWS's REST API. Everything else is built upon it at some point. If you feel adventurous, here's the S3 REST API documentation: http://docs.aws.amazon.com/AmazonS3/latest/API/APIRest.html

对S3的最新访问形式是通过AWS的REST API。在某些时候,其他一切都建立在它之上。如果你喜欢冒险,那么这里是S3 REST API文档:http://docs.aws.amazon.com/AmazonS3/latest/API/APIRest.html