aws: Amazon Web Services (AWS) for Haskell

This is a package candidate release! Here you can preview how this package release will appear once published to the main package index (which can be accomplished via the 'maintain' link below). Please note that once a package has been published to the main package index it cannot be undone! Please consult the package uploading documentation for more information.

[maintain] [Publish]

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, 0.14.1, 0.15, 0.15.1, 0.16, 0.17, 0.17.1, 0.18, 0.19, 0.20, 0.21, 0.21.1, 0.22, 0.22.1, 0.23, 0.24, 0.24, 0.24.1, 0.24.2
Change log CHANGELOG.md
Dependencies aeson (>=2.0.0.0), attoparsec (>=0.11 && <0.15), aws, base (>=4.9 && <5), base16-bytestring (>=0.1 && <1.1), base64-bytestring (>=1.0 && <1.3), blaze-builder (>=0.2.1.4 && <0.5), byteable (>=0.1 && <0.2), bytestring (>=0.9 && <0.12), case-insensitive (>=0.2 && <1.3), cereal (>=0.3 && <0.6), conduit (>=1.3 && <1.4), conduit-extra (>=1.3 && <1.4), containers (>=0.4), cryptonite (>=0.11), data-default (>=0.5.3 && <0.8), directory (>=1.0 && <2.0), errors (>=2.0), exceptions (>=0.8 && <0.11), filepath (>=1.1 && <1.5), ghc-prim, http-client-tls (>=0.3 && <0.4), http-conduit (>=2.3 && <2.4), http-types (>=0.7 && <1.0), lifted-base (>=0.1 && <0.3), memory, monad-control (>=0.3), mtl (>=2 && <3), network (>=2 && <4), network-bsd (>=2.8 && <2.9), old-locale (>=1 && <2), resourcet (>=1.2 && <1.3), safe (>=0.3 && <0.4), scientific (>=0.3), semigroups (>=0.18 && <0.19), tagged (>=0.7 && <0.9), text (>=0.11), time (>=1.4.0 && <2.0), transformers (>=0.2.2 && <0.6), unordered-containers (>=0.2), utf8-string (>=0.3 && <1.1), vector (>=0.10), xml-conduit (>=1.8 && <2.0) [details]
License BSD-3-Clause
Copyright See contributors list in README and LICENSE file
Author Aristid Breitkreuz, contributors see README
Maintainer aristidb@gmail.com
Category Network, Web, AWS, Cloud, Distributed Computing
Home page http://github.com/aristidb/aws
Source repo this: git clone https://github.com/aristidb/aws.git(tag 0.24)
head: git clone https://github.com/aristidb/aws.git
Uploaded by JoeyHess at 2023-02-06T19:35:52Z

Modules

[Index] [Quick Jump]

Flags

Automatic Flags
NameDescriptionDefault
examples

Build the examples.

Disabled
networkbsd

Build with network-3.0 which split out network-bsd

Enabled

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

Downloads

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees


Readme for aws-0.24

[back to package description]

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           Control.Monad.Trans.Resource
import           Data.Conduit ((.|), runConduit)
import           Data.Conduit.Binary (sinkFile)
import           Network.HTTP.Conduit (newManager, tlsManagerSettings, 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. -}
  mgr <- newManager tlsManagerSettings
  runResourceT $ 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. -}
    runConduit $ 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

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
Joey Hess joeyh id@joeyh.name - Co-Maintainer, S3