amazonka-0.0.1: Comprehensive Amazon Web Services SDK

Safe HaskellNone
LanguageHaskell2010

Network.AWS

Contents

Description

The core module for making requests to the various AWS services.

Synopsis

Environment

data Env Source

The environment containing the parameters required to make AWS requests.

Instances

Creating the environment

data Credentials :: *

Determines how authentication information is retrieved.

Constructors

FromKeys AccessKey SecretKey

Explicit access and secret keys. Note: you can achieve the same result purely by using fromKeys.

FromSession AccessKey SecretKey SecurityToken

A session containing the access key, secret key, and a security token. Note: you can achieve the same result purely by using fromSession.

FromProfile Text

An IAM Profile name to lookup from the local EC2 instance-data.

FromEnv Text Text

Environment variables to lookup for the access and secret keys.

Discover

Attempt to read the default access and secret keys from the environment, falling back to the first available IAM profile if they are not set.

Note: This attempts to resolve http://instance-data rather than directly retrieving http://169.254.169.254 for IAM profile information to ensure the dns lookup terminates promptly if not running on EC2.

newEnv :: (Functor m, MonadIO m) => Region -> Credentials -> Manager -> ExceptT String m Env Source

This creates a new environment without debug logging and uses getAuth to expand/discover the supplied Credentials.

Lenses such as envLogger can be used to modify the Env with a debug logger.

getEnv :: Region -> Credentials -> IO Env Source

Create a new environment without debug logging, creating a new Manager.

Any errors are thrown using error.

See: newEnv

Requests

Synchronous

send :: (MonadCatch m, MonadResource m, AWSRequest a) => Env -> a -> m (Response a) Source

Send a data type which is an instance of AWSRequest, returning either the associated Rs response type in the success case, or the related service's Er type in the error case.

This includes HTTPExceptions, serialisation errors, and any service errors returned as part of the Response.

Paginated

paginate :: (MonadCatch m, MonadResource m, AWSPager a) => Env -> a -> Source m (Response a) Source

Send a data type which is an instance of AWSPager and paginate over the associated Rs response type in the success case, or the related service's Er type in the error case.

Note: The ResumableSource will close when there are no more results or the ResourceT computation is unwrapped. See: runResourceT for more information.

Pre-signing URLs

presign Source

Arguments

:: (MonadIO m, AWSRequest a, AWSPresigner (Sg (Sv a))) 
=> Env 
-> a

Request to presign.

-> UTCTime

Signing time.

-> UTCTime

Expiry time.

-> m (Signed a (Sg (Sv a))) 

Presign a URL with expiry to be used at a later time.

Note: Requires the service's signer to be an instance of AWSPresigner. Not all signing process support this.

Types