56

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.

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

1 Answer 1

56

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

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

$ aws s3 sync . s3://mybucket

Full documentation on this command: 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".

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

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 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/

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

7
  • 5
    Are there any benchmarks comparing data transfer rates using s3cmd to awscli? Commented Mar 13, 2015 at 14:27
  • There are s3cmd official packages for Ubuntu: packages.ubuntu.com/trusty/s3cmd
    – Daniel
    Commented Mar 16, 2015 at 1:27
  • 2
    Also check out s4cmd. While it doesn't have all the features of s3cmd, its performance is definitely better over high-bandwidth connections (e.g. on EC2), since it multithreads the connections. github.com/bloomreach/s4cmd
    – jlevy
    Commented Aug 23, 2015 at 2:55
  • 4
    "AWS CLI gives you only the basic commands" isn't true, aws s3 * is just the simplified interface, the full REST API is available under aws s3api * Commented Feb 10, 2016 at 22:56
  • 3
    It's not quite true s3cmd gives you everything aws-cli does. In particular, it's slower as it does not have parallel workers/connections. (s4cmd has this too.)
    – jlevy
    Commented Aug 26, 2016 at 0:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.