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

查看:474
本文介绍了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?

推荐答案

s3cmd

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上(它也是

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可能会涉及更多,因为在任何发行版主存储库中似乎都不是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天全站免登陆