aws-easy-0.1.0.0: AWS Easy: Helper functions for working with amazonka

Copyright(C) Richard Cook 2018
LicenseMIT
Maintainerrcook@rcook.org
Stabilityexperimental
Portabilityportable
Safe HaskellNone
LanguageHaskell2010

Network.AWS.Easy.Prelude

Description

This module provides re-exports of most commonly used Amazonka functions as well as lens and error-handling functions.

Synopsis

Documentation

(^.) :: s -> Getting a s a -> a infixl 8 #

View the value pointed to by a Getter or Lens or the result of folding over all the results of a Fold or Traversal that points at a monoidal values.

This is the same operation as view with the arguments flipped.

The fixity and semantics are such that subsequent field accesses can be performed with (.).

>>> (a,b)^._2
b
>>> ("hello","world")^._2
"world"
>>> import Data.Complex
>>> ((0, 1 :+ 2), 3)^._1._2.to magnitude
2.23606797749979
(^.) ::             s -> Getter s a     -> a
(^.) :: Monoid m => s -> Fold s m       -> m
(^.) ::             s -> Iso' s a       -> a
(^.) ::             s -> Lens' s a      -> a
(^.) :: Monoid m => s -> Traversal' s m -> m

(&) :: a -> (a -> b) -> b infixl 1 #

& is a reverse application operator. This provides notational convenience. Its precedence is one higher than that of the forward application operator $, which allows & to be nested in $.

Since: 4.8.0.0

(.~) :: ASetter s t a b -> b -> s -> t infixr 4 #

Replace the target of a Lens or all of the targets of a Setter or Traversal with a constant value.

This is an infix version of set, provided for consistency with (.=).

f <$ a ≡ mapped .~ f $ a
>>> (a,b,c,d) & _4 .~ e
(a,b,c,e)
>>> (42,"world") & _1 .~ "hello"
("hello","world")
>>> (a,b) & both .~ c
(c,c)
(.~) :: Setter s t a b    -> b -> s -> t
(.~) :: Iso s t a b       -> b -> s -> t
(.~) :: Lens s t a b      -> b -> s -> t
(.~) :: Traversal s t a b -> b -> s -> t

_ServiceError :: AsError a => Prism' a ServiceError #

A service specific error returned by the remote service.

data Credentials :: * #

Determines how AuthN/AuthZ information is retrieved.

Constructors

FromKeys AccessKey SecretKey

Explicit access and secret keys. See fromKeys.

FromSession AccessKey SecretKey SessionToken

Explicit access key, secret key and a session token. See fromSession.

FromEnv Text Text (Maybe Text) (Maybe Text)

Lookup specific environment variables for access key, secret key, an optional session token, and an optional region, respectively.

FromProfile Text

An IAM Profile name to lookup from the local EC2 instance-data. Environment variables to lookup for the access key, secret key and optional session token.

FromFile Text FilePath

A credentials profile name (the INI section) and the path to the AWS credentials file.

FromContainer

Obtain credentials by attempting to contact the ECS container agent at http://169.254.170.2 using the path in envContainerCredentialsURI. See IAM Roles for Tasks in the AWS documentation for more information.

Discover

Attempt credentials discovery via the following steps:

  • Read the envAccessKey, envSecretKey, and envRegion from the environment if they are set.
  • Read the credentials file if credFile exists.
  • Obtain credentials from the ECS container agent if envContainerCredentialsURI is set.
  • Retrieve the first available IAM profile and read the Region from the instance identity document, if running on EC2.

An attempt is made to resolve http://instance-data rather than directly retrieving http://169.254.169.254 for IAM profile information. This assists in ensuring the DNS lookup terminates promptly if not running on EC2.

data Region :: * #

The available AWS regions.

Constructors

NorthVirginia

US East ('us-east-1').

Ohio

US East ('us-east-2').

NorthCalifornia

US West ('us-west-1').

Oregon

US West ('us-west-2').

Montreal

Canada ('ca-central-1').

Tokyo

Asia Pacific ('ap-northeast-1').

Seoul

Asia Pacific ('ap-northeast-2').

Mumbai

Asia Pacific ('ap-south-1').

Singapore

Asia Pacific ('ap-southeast-1').

Sydney

Asia Pacific ('ap-southeast-2').

SaoPaulo

South America ('sa-east-1').

Ireland

EU ('eu-west-1').

London

EU ('eu-west-2').

Frankfurt

EU ('eu-central-1').

GovCloud

US GovCloud ('us-gov-west-1').

GovCloudFIPS

US GovCloud FIPS (S3 Only, 'fips-us-gov-west-1').

Beijing

China ('cn-north-1').

Instances

Bounded Region 
Enum Region 
Eq Region 

Methods

(==) :: Region -> Region -> Bool #

(/=) :: Region -> Region -> Bool #

Data Region 

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Region -> c Region #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Region #

toConstr :: Region -> Constr #

dataTypeOf :: Region -> DataType #

dataCast1 :: Typeable (* -> *) t => (forall d. Data d => c (t d)) -> Maybe (c Region) #

dataCast2 :: Typeable (* -> * -> *) t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Region) #

gmapT :: (forall b. Data b => b -> b) -> Region -> Region #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Region -> r #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Region -> r #

gmapQ :: (forall d. Data d => d -> u) -> Region -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> Region -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> Region -> m Region #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Region -> m Region #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Region -> m Region #

Ord Region 
Read Region 
Show Region 
Generic Region 

Associated Types

type Rep Region :: * -> * #

Methods

from :: Region -> Rep Region x #

to :: Rep Region x -> Region #

Hashable Region 

Methods

hashWithSalt :: Int -> Region -> Int #

hash :: Region -> Int #

ToJSON Region 
FromJSON Region 
ToText Region 

Methods

toText :: Region -> Text #

FromText Region 

Methods

parser :: Parser Region #

ToByteString Region 

Methods

toBS :: Region -> ByteString #

ToLog Region 

Methods

build :: Region -> Builder #

NFData Region 

Methods

rnf :: Region -> () #

FromXML Region 
ToXML Region 

Methods

toXML :: Region -> XML #

type Rep Region 
type Rep Region = D1 * (MetaData "Region" "Network.AWS.Types" "amazonka-core-1.5.0-HgQZvo4hXGrQuZEP3LdNA" False) ((:+:) * ((:+:) * ((:+:) * ((:+:) * (C1 * (MetaCons "NorthVirginia" PrefixI False) (U1 *)) (C1 * (MetaCons "Ohio" PrefixI False) (U1 *))) ((:+:) * (C1 * (MetaCons "NorthCalifornia" PrefixI False) (U1 *)) (C1 * (MetaCons "Oregon" PrefixI False) (U1 *)))) ((:+:) * ((:+:) * (C1 * (MetaCons "Montreal" PrefixI False) (U1 *)) (C1 * (MetaCons "Tokyo" PrefixI False) (U1 *))) ((:+:) * (C1 * (MetaCons "Seoul" PrefixI False) (U1 *)) (C1 * (MetaCons "Mumbai" PrefixI False) (U1 *))))) ((:+:) * ((:+:) * ((:+:) * (C1 * (MetaCons "Singapore" PrefixI False) (U1 *)) (C1 * (MetaCons "Sydney" PrefixI False) (U1 *))) ((:+:) * (C1 * (MetaCons "SaoPaulo" PrefixI False) (U1 *)) (C1 * (MetaCons "Ireland" PrefixI False) (U1 *)))) ((:+:) * ((:+:) * (C1 * (MetaCons "London" PrefixI False) (U1 *)) (C1 * (MetaCons "Frankfurt" PrefixI False) (U1 *))) ((:+:) * (C1 * (MetaCons "GovCloud" PrefixI False) (U1 *)) ((:+:) * (C1 * (MetaCons "GovCloudFIPS" PrefixI False) (U1 *)) (C1 * (MetaCons "Beijing" PrefixI False) (U1 *)))))))

await :: (MonadAWS m, AWSRequest a) => Wait a -> a -> m Accept #

Poll the API with the supplied request until a specific Wait condition is fulfilled.

send :: (MonadAWS m, AWSRequest a) => a -> m (Rs a) #

Send a request, returning the associated response if successful.

sinkBody :: MonadResource m => RsBody -> Sink ByteString m a -> m a #

Connect a Sink to a response stream.

toText :: ToText a => a -> Text #