s3cmd、boto 和 AWS CLI 之间的区别 [英] Difference between s3cmd, boto and AWS CLI

查看:42
本文介绍了s3cmd、boto 和 AWS CLI 之间的区别的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在考虑将我的静态网站重新部署到 Amazon S3.我需要自动化部署,所以我正在寻找用于此类任务的 API.我对不同的选项有点困惑.

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.

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

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

推荐答案

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

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).

AWS CLI 通过s3"命令为您提供简单的文件复制功能,这足以将静态网站部署到 S3 存储桶.它还具有一些小优势,例如预装在 Amazon Linux 上,如果那是您工作的地方(它也是 可以通过 pip 轻松安装.

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).

一个适用于将本地目录同步到 S3 存储桶的 AWS CLI 命令:

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

$ aws s3 sync . s3://mybucket

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

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

正如@simon-buchan 在评论中提到的,aws s3api 命令可让您访问完整的 S3 API,但其界面更原始".

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".

s3cmd 支持 AWS CLI 所做的一切,此外还添加了一些更多的扩展功能,但我不确定您是否需要其中的任何功能.你可以在这里看到它的所有命令:http://s3tools.org/usage

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 可能有点复杂,因为它似乎不是任何发行版主存储库中的软件包.

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

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

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/

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

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

这篇关于s3cmd、boto 和 AWS CLI 之间的区别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆