Safe Haskell | None |
---|---|
Language | Haskell2010 |
The core module for making requests to the various AWS services.
- data Env
- envAuth :: Lens' Env Auth
- envRegion :: Lens' Env Region
- envManager :: Lens' Env Manager
- envLogger :: Lens' Env Logger
- data Credentials :: *
- newEnv :: (Functor m, MonadIO m) => Region -> Credentials -> Manager -> ExceptT String m Env
- getEnv :: Region -> Credentials -> IO Env
- send :: (MonadCatch m, MonadResource m, AWSRequest a) => Env -> a -> m (Response a)
- paginate :: (MonadCatch m, MonadResource m, AWSPager a) => Env -> a -> Source m (Response a)
- presign :: (MonadIO m, AWSRequest a, AWSPresigner (Sg (Sv a))) => Env -> a -> UTCTime -> UTCTime -> m (Signed a (Sg (Sv a)))
- module Network.AWS.Types
Environment
The environment containing the parameters required to make AWS requests.
Monad m => MonadReader Env (AWST m) |
Creating the environment
data Credentials :: *
Determines how authentication information is retrieved.
FromKeys AccessKey SecretKey | Explicit access and secret keys.
Note: you can achieve the same result purely by using |
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 |
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.
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
:: (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
module Network.AWS.Types