The aws package

[Tags:bsd3, library, test]

Bindings for Amazon Web Services (AWS), with the aim of supporting all AWS services. To see a high level overview of the library, see the README at https://github.com/aristidb/aws/blob/master/README.md.


[Skip to Readme]

Properties

Versions 0.0.1, 0.0.2, 0.0.3, 0.0.4, 0.0.5, 0.0.6, 0.1, 0.2, 0.3, 0.3.1, 0.3.2, 0.4.0, 0.4.0.1, 0.4.1, 0.5.0, 0.6.0, 0.6.1, 0.6.2, 0.7.0, 0.7.1, 0.7.2, 0.7.3, 0.7.4, 0.7.5, 0.7.6, 0.7.6.1, 0.7.6.2, 0.7.6.3, 0.7.6.4, 0.8.0, 0.8.1, 0.8.2, 0.8.3, 0.8.4, 0.8.5, 0.8.6, 0.9, 0.9.1, 0.9.2, 0.9.3, 0.9.4, 0.9.5, 0.10, 0.10.1, 0.10.2, 0.10.3, 0.10.4, 0.10.5, 0.11, 0.11.1, 0.11.2, 0.11.3, 0.11.4, 0.12, 0.12.1, 0.13.0, 0.13.1, 0.13.2, 0.14.0
Change log CHANGELOG.md
Dependencies aeson (>=0.6), attoparsec (>=0.11 && <0.14), aws, base (>=4.6 && <5), base16-bytestring (==0.1.*), base64-bytestring (==1.0.*), blaze-builder (>=0.2.1.4 && <0.5), byteable (==0.1.*), bytestring (>=0.9 && <0.11), case-insensitive (>=0.2 && <1.3), cereal (>=0.3 && <0.6), conduit (>=1.1 && <1.3), conduit-extra (==1.1.*), containers (>=0.4), cryptohash (==0.11.*), data-default (>=0.5.3 && <0.8), directory (>=1.0 && <1.3), errors (>=2.0), exceptions, filepath (>=1.1 && <1.5), ghc-prim, http-conduit (==2.1.*), http-types (>=0.7 && <0.10), lifted-base (>=0.1 && <0.3), monad-control (>=0.3), mtl (==2.*), network (==2.*), old-locale (==1.*), resourcet (==1.1.*), safe (==0.3.*), scientific (>=0.3), tagged (>=0.7 && <0.9), text (>=0.11), time (>=1.1.4 && <2.0), transformers (>=0.2.2 && <0.6), unordered-containers (>=0.2), utf8-string (>=0.3 && <1.1), vector (>=0.10), xml-conduit (>=1.2 && <1.4) [details]
License BSD3
Copyright See contributors list in README and LICENSE file
Author Aristid Breitkreuz, contributors see README
Maintainer aristidb@gmail.com
Stability Unknown
Category Network, Web, AWS, Cloud, Distributed Computing
Home page http://github.com/aristidb/aws
Source repository this: git clone https://github.com/aristidb/aws.git(tag 0.14.0)
head: git clone https://github.com/aristidb/aws.git
Uploaded Sat Jun 4 16:23:54 UTC 2016 by AristidBreitkreuz
Distributions Arch:0.14.0, Debian:0.13.0, FreeBSD:0.12.1, LTSHaskell:0.13.2, NixOS:0.14.0, Tumbleweed:0.13.2
Downloads 16956 total (142 in the last 30 days)
Votes
0 []
Status Docs available [build log]
Last success reported on 2016-06-04 [all 1 reports]

Modules

[Index]

Flags

NameDescriptionDefaultType
examplesBuild the examples.DisabledAutomatic

Use -f <flag> to enable a flag, or -f -<flag> to disable that flag. More info

Downloads

Maintainer's Corner

For package maintainers and hackage trustees

Readme for aws

Readme for aws-0.14.0

Introduction

The aws package attempts to provide support for using Amazon Web Services like S3 (storage), SQS (queuing) and others to Haskell programmers. The ultimate goal is to support all Amazon Web Services.

Installation

Make sure you have a recent GHC installed, as well as cabal-install, and installation should be as easy as:

$ cabal install aws

If you prefer to install from source yourself, you should first get a clone of the aws repository, and install it from inside the source directory:

$ git clone https://github.com/aristidb/aws.git
$ cd aws
$ cabal install

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

{-# LANGUAGE OverloadedStrings #-}

import qualified Aws
import qualified Aws.S3 as S3
import           Data.Conduit (($$+-))
import           Data.Conduit.Binary (sinkFile)
import           Network.HTTP.Conduit (withManager, responseBody)

main :: IO ()
main = do
  {- Set up AWS credentials and the default configuration. -}
  cfg <- Aws.baseConfiguration
  let s3cfg = Aws.defServiceConfig :: S3.S3Configuration Aws.NormalQuery

  {- Set up a ResourceT region with an available HTTP manager. -}
  withManager $ \mgr -> do
    {- Create a request object with S3.getObject and run the request with pureAws. -}
    S3.GetObjectResponse { S3.gorResponse = rsp } <-
      Aws.pureAws cfg s3cfg mgr $
        S3.getObject "haskell-aws" "cloud-remote.pdf"

    {- Save the response to a file. -}
    responseBody rsp $$+- sinkFile "cloud-remote.pdf"

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

See CHANGELOG

Resources

Contributors

Name |Github |E-Mail |Company |Components --------------------|-------------------------------------------------|--------------------------------|-----------------------------------------------------|-------------------- Abhinav Gupta |abhinav |mail@abhinavg.net |- |IAM, SES Aristid Breitkreuz |aristidb |aristidb@gmail.com |- |Co-Maintainer Bas van Dijk |basvandijk |v.dijk.bas@gmail.com |Erudify AG |S3 David Vollbracht |qxjit | | | Felipe Lessa |meteficha |felipe.lessa@gmail.com |currently secret |Core, S3, SES Nathan Howell |NathanHowell |nhowell@alphaheavy.com |Alpha Heavy Industries |S3 Ozgun Ataman |ozataman |ozgun.ataman@soostone.com |Soostone Inc |Core, S3, DynamoDb Steve Severance |sseveran |sseverance@alphaheavy.com |Alpha Heavy Industries |S3, SQS John Wiegley |jwiegley |johnw@fpcomplete.com |FP Complete |Co-Maintainer, S3 Chris Dornan |cdornan |chris.dornan@irisconnect.co.uk |Iris Connect |Core John Lenz |wuzzeb | | |DynamoDB, Core