aws (command line tool)Edit

aws is a simplified command line interface to Amazon Web Services.

Official website


To install to the bin directory in your home directory:

$ curl -o ~/bin/aws
$ chmod +x ~/bin/aws

MIME types

If you have an appropriate /etc/mime.types file the aws tool will automatically set the correct Content-Type for you based on the file extension. I have a very brief MIME types file that covers the basic file types that I expect to be distributing using Amazon S3:

application/octet-stream  bin dmg img iso pkg
application/ogg ogg
application/pdf pdf
application/x-bzip2 bz2
application/x-gzip  gz tgz
application/x-tar tar
application/zip zip
audio/mpeg  mp3
image/gif gif
image/jpeg  jpeg
image/png png
text/plain  txt
video/mpeg  mpeg mpg
video/quicktime mov


The main bucket I use for public distribution via HTTP is (See "HTTPS access to Amazon S3 buckets" for info on distribution via HTTPS.)

"Objects" uploaded into the bucket (really files) are identified by textual keys. Keys can have path-like names to give the appearance of hierarchical organization, but in reality buckets are just shallow/flat collections. This means that the following "paths" all refer to objects in the "top" (and only) level in the bucket:

  • synergy/releases/
  • wikitext/releases/wikitext-2.0.gem.bz2
  • publications/novel.pdf

As an example, to upload into the appropriate bucket:

$ aws put /local/path/to/
$ aws put --public

The second line is necessary to override the default ACL (which only allows the owner access to the object but nobody else).

See also