Using aws

Concepts and organisation

The aws package is organised into the general Aws module namespace, and subnamespaces like Aws.S3 for each Amazon Web
Service. Under each service namespace in turn, there are general support modules and and Aws.<Service>.Commands.<Command>
module for each command. For easier usage, there are the “bundling” modules Aws (general support), and Aws.<Service>.

The primary concept in aws is the Transaction, which corresponds to a single HTTP request to the Amazon Web Services.
A transaction consists of a request and a response, which are associated together via the Transaction typeclass. Requests
and responses are simple Haskell records, but for some requests there are convenience functions to fill in default values
for many parameters.

Example usage

To be able to access AWS resources, you should put your into a configuration file. (You don’t have to store it in a file,
but that’s how we do it in this example.) Save the following in $HOME/.aws-keys.

default AccessKeyID SecretKey

You do have to replace AccessKeyID and SecretKey with the Access Key ID and the Secret Key respectively, of course.

Then, copy this example into a Haskell file, and run it with runghc (after installing aws):

You can also find this example in the source distribution in the Examples/ folder.

Frequently Asked Questions

S3 questions

I get an error when I try to access my bucket with upper-case characters / a very long name.

Those names are not compliant with DNS. You need to use path-style requests, by setting s3RequestStyle in the configuration to
PathStyle. Note that such bucket names are only allowed in the US standard region, so your endpoint needs to be US standard.

Release Notes

0.7 series

0.7.5

Support for http-conduit 1.7 and 1.8

0.7.1-0.7.4

Support for GHC 7.6

Wider constraints to support newer versions of various dependencies

Update maintainer e-mail address and project categories in cabal file

0.7.0

Change ServiceConfiguration concept so as to indicate in the type whether this is for URI-only requests
(i.e. awsUri)

EXPERIMENTAL: Direct support for iterated transaction, i.e. such where multiple HTTP requests might be necessary due to e.g. response size limits.

Put aws functions in ResourceT to be able to safely return Sources and streams.