-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/
-- | Comprehensive Amazon Web Services SDK
--
@package amazonka
@version 1.3.2
-- | Re-exports some of the underlying textual and byte serialisation
-- mechanisms for convenience.
--
-- Many of the AWS identifiers like S3's ObjectVersionId or
-- ETag, as well as any nullary sum types such as Region
-- have ToText and ToByteString instances, making it
-- convenient to use the type classes to convert a value to its textual
-- representation.
module Network.AWS.Data
class FromText a
parser :: FromText a => Parser a
fromText :: FromText a => Text -> Either String a
-- | Fail parsing with a Text error.
--
-- Constrained to the actual attoparsec monad to avoid exposing
-- fail usage directly.
fromTextError :: Text -> Parser a
takeLowerText :: Parser Text
class ToText a
toText :: ToText a => a -> Text
class ToByteString a
toBS :: ToByteString a => a -> ByteString
class ToLog a
build :: ToLog a => a -> Builder
-- | This module contains functions for presigning requests using
-- MonadIO and not one of the AWS specific transformers.
--
-- It is intended for use directly with Network.AWS.Auth when only
-- presigning and no other AWS actions are required.
module Network.AWS.Presign
-- | Presign an URL that is valid from the specified time until the number
-- of seconds expiry has elapsed.
--
-- See: presign, presignWith
presignURL :: (MonadIO m, AWSRequest a) => Auth -> Region -> UTCTime -> Seconds -> a -> m ByteString
-- | Presign an HTTP request that is valid from the specified time until
-- the number of seconds expiry has elapsed.
--
-- See: presignWith
presign :: (MonadIO m, AWSRequest a) => Auth -> Region -> UTCTime -> Seconds -> a -> m ClientRequest
-- | A variant of presign that allows modifying the default
-- Service definition used to configure the request.
presignWith :: (MonadIO m, AWSRequest a) => (Service -> Service) -> Auth -> Region -> UTCTime -> Seconds -> a -> m ClientRequest
-- | This module contains functions for retrieving various EC2 metadata
-- from an instance's local metadata endpoint using MonadIO and
-- not one of the AWS specific transformers.
--
-- It is intended to be used when you need to make metadata calls prior
-- to initialisation of the Env.
module Network.AWS.EC2.Metadata
-- | Test whether the underlying host is running on EC2 by making an HTTP
-- request to http://instance-data/latest.
isEC2 :: MonadIO m => Manager -> m Bool
-- | Retrieve the specified Dynamic data.
--
-- Throws HttpException if HTTP communication fails.
dynamic :: (MonadIO m, MonadThrow m) => Manager -> Dynamic -> m ByteString
-- | Retrieve the specified Metadata.
--
-- Throws HttpException if HTTP communication fails.
metadata :: (MonadIO m, MonadThrow m) => Manager -> Metadata -> m ByteString
-- | Retrieve the user data. Returns Nothing if no user data is
-- assigned to the instance.
--
-- Throws HttpException if HTTP communication fails.
userdata :: (MonadIO m, MonadCatch m) => Manager -> m (Maybe ByteString)
data Dynamic
-- | Value showing whether the customer has enabled detailed one-minute
-- monitoring in CloudWatch.
--
-- Valid values: enabled | disabled.
FWS :: Dynamic
-- | JSON containing instance attributes, such as instance-id, private IP
-- address, etc.
Document :: Dynamic
-- | Used to verify the document's authenticity and content against the
-- signature.
PKCS7 :: Dynamic
Signature :: Dynamic
data Metadata
-- | The AMI ID used to launch the instance.
AMIId :: Metadata
-- | If you started more than one instance at the same time, this value
-- indicates the order in which the instance was launched. The value of
-- the first instance launched is 0.
AMILaunchIndex :: Metadata
-- | The path to the AMI's manifest file in Amazon S3. If you used an
-- Amazon EBS-backed AMI to launch the instance, the returned result is
-- unknown.
AMIManifestPath :: Metadata
-- | The AMI IDs of any instances that were rebundled to create this AMI.
-- This value will only exist if the AMI manifest file contained an
-- ancestor-amis key.
AncestorAMIIds :: Metadata
-- | See: Mapping
BlockDevice :: !Mapping -> Metadata
-- | The private hostname of the instance. In cases where multiple network
-- interfaces are present, this refers to the eth0 device (the device for
-- which the device number is 0).
Hostname :: Metadata
-- | See: Info
IAM :: !Info -> Metadata
-- | Notifies the instance that it should reboot in preparation for
-- bundling. Valid values: none | shutdown | bundle-pending.
InstanceAction :: Metadata
-- | The ID of this instance.
InstanceId :: Metadata
-- | The type of instance.
--
-- See: InstanceType
InstanceType :: Metadata
-- | The ID of the kernel launched with this instance, if applicable.
KernelId :: Metadata
-- | The private DNS hostname of the instance. In cases where multiple
-- network interfaces are present, this refers to the eth0 device (the
-- device for which the device number is 0).
LocalHostname :: Metadata
-- | The private IP address of the instance. In cases where multiple
-- network interfaces are present, this refers to the eth0 device (the
-- device for which the device number is 0).
LocalIPV4 :: Metadata
-- | The instance's media access control (MAC) address. In cases where
-- multiple network interfaces are present, this refers to the eth0
-- device (the device for which the device number is 0).
MAC :: Metadata
-- | See: Interface
Network :: !Text -> !Interface -> Metadata
-- | The Availability Zone in which the instance launched.
AvailabilityZone :: Metadata
-- | Product codes associated with the instance, if any.
ProductCodes :: Metadata
-- | The instance's public DNS. If the instance is in a VPC, this category
-- is only returned if the enableDnsHostnames attribute is set to true.
-- For more information, see Using DNS with Your VPC.
PublicHostname :: Metadata
-- | The public IP address. If an Elastic IP address is associated with the
-- instance, the value returned is the Elastic IP address.
PublicIPV4 :: Metadata
-- | Public key. Only available if supplied at instance launch time.
OpenSSHKey :: Metadata
-- | The ID of the RAM disk specified at launch time, if applicable.
RAMDiskId :: Metadata
-- | ID of the reservation.
ReservationId :: Metadata
-- | The names of the security groups applied to the instance.
SecurityGroups :: Metadata
data Mapping
-- | The virtual device that contains the root/boot file system.
AMI :: Mapping
-- | The virtual devices associated with Amazon EBS volumes, if present.
-- This value is only available in metadata if it is present at launch
-- time. The N indicates the index of the Amazon EBS volume (such as ebs1
-- or ebs2).
EBS :: !Int -> Mapping
-- | The virtual devices associated with ephemeral devices, if present. The
-- N indicates the index of the ephemeral volume.
Ephemeral :: !Int -> Mapping
-- | The virtual devices or partitions associated with the root devices, or
-- partitions on the virtual device, where the root (/ or C:) file system
-- is associated with the given instance.
Root :: Mapping
-- | The virtual devices associated with swap. Not always present.
Swap :: Mapping
data Info
-- | Returns information about the last time the instance profile was
-- updated, including the instance's LastUpdated date,
-- InstanceProfileArn, and InstanceProfileId.
Info' :: Info
-- | Where role-name is the name of the IAM role associated with the
-- instance. Returns the temporary security credentials.
--
-- See: Auth for JSON deserialisation.
SecurityCredentials :: (Maybe Text) -> Info
data Interface
-- | The device number associated with that interface. Each interface must
-- have a unique device number. The device number serves as a hint to
-- device naming in the instance; for example, device-number is 2 for the
-- eth2 device.
IDeviceNumber :: Interface
-- | The private IPv4 addresses that are associated with each public-ip
-- address and assigned to that interface.
IIPV4Associations :: !Text -> Interface
-- | The interface's local hostname.
ILocalHostname :: Interface
-- | The private IP addresses associated with the interface.
ILocalIPV4s :: Interface
-- | The instance's MAC address.
IMAC :: Interface
-- | The ID of the owner of the network interface. In multiple-interface
-- environments, an interface can be attached by a third party, such as
-- Elastic Load Balancing. Traffic on an interface is always billed to
-- the interface owner.
IOwnerId :: Interface
-- | The interface's public DNS. If the instance is in a VPC, this category
-- is only returned if the enableDnsHostnames attribute is set to true.
-- For more information, see Using DNS with Your VPC.
IPublicHostname :: Interface
-- | The Elastic IP addresses associated with the interface. There may be
-- multiple IP addresses on an instance.
IPublicIPV4s :: Interface
-- | Security groups to which the network interface belongs. Returned only
-- for instances launched into a VPC.
ISecurityGroups :: Interface
-- | IDs of the security groups to which the network interface belongs.
-- Returned only for instances launched into a VPC. For more information
-- on security groups in the EC2-VPC platform, see Security Groups for
-- Your VPC.
ISecurityGroupIds :: Interface
-- | The ID of the subnet in which the interface resides. Returned only for
-- instances launched into a VPC.
ISubnetId :: Interface
-- | The CIDR block of the subnet in which the interface resides. Returned
-- only for instances launched into a VPC.
ISubnetIPV4_CIDRBlock :: Interface
-- | The ID of the VPC in which the interface resides. Returned only for
-- instances launched into a VPC.
IVPCId :: Interface
-- | The CIDR block of the VPC in which the interface resides. Returned
-- only for instances launched into a VPC.
IVPCIPV4_CIDRBlock :: Interface
instance Typeable Dynamic
instance Typeable Mapping
instance Typeable Interface
instance Typeable Info
instance Typeable Metadata
instance Eq Dynamic
instance Ord Dynamic
instance Show Dynamic
instance Eq Mapping
instance Ord Mapping
instance Show Mapping
instance Eq Interface
instance Ord Interface
instance Show Interface
instance Eq Info
instance Ord Info
instance Show Info
instance Eq Metadata
instance Ord Metadata
instance Show Metadata
instance ToText Info
instance ToText Interface
instance ToText Mapping
instance ToText Metadata
instance ToText Dynamic
-- | Explicitly specify your Amazon AWS security credentials, or retrieve
-- them from the underlying OS.
--
-- The format of environment variables and the credentials file follows
-- the official AWS SDK guidelines.
module Network.AWS.Auth
-- | Retrieve authentication information via the specified
-- Credentials mechanism.
--
-- Throws AuthError when environment variables or IAM profiles
-- cannot be read, and credentials files are invalid or cannot be found.
getAuth :: (Applicative m, MonadIO m, MonadCatch m) => Manager -> Credentials -> m Auth
-- | Determines how AuthN/AuthZ information is retrieved.
data Credentials
-- | Explicit access and secret keys. See fromKeys.
FromKeys :: AccessKey -> SecretKey -> Credentials
-- | Explicit access key, secret key and a session token. See
-- fromSession.
FromSession :: AccessKey -> SecretKey -> SessionToken -> Credentials
-- | Lookup specific environment variables for access key, secret key, and
-- an optional session token respectively.
FromEnv :: Text -> Text -> (Maybe Text) -> Credentials
-- | 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.
FromProfile :: Text -> Credentials
-- | A credentials profile name (the INI section) and the path to the AWS
-- credentials file.
FromFile :: Text -> FilePath -> Credentials
-- | Attempt to credentials discovery via the following steps:
--
--
-- - Read the envAccessKey and envSecretKey from the
-- environment if they are set.
-- - Read the credentials file if credFile exists.
-- - Retrieve the first available IAM profile 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.
Discover :: Credentials
-- | An authorisation environment containing AWS credentials, and
-- potentially a reference which can be refreshed out-of-band as
-- temporary credentials expire.
data Auth :: *
-- | Default access key environment variable.
envAccessKey :: Text
-- | Default secret key environment variable.
envSecretKey :: Text
-- | Default session token environment variable.
envSessionToken :: Text
-- | Credentials INI file access key variable.
credAccessKey :: Text
-- | Credentials INI file secret key variable.
credSecretKey :: Text
-- | Credentials INI file session token variable.
credSessionToken :: Text
-- | Credentials INI default profile section variable.
credProfile :: Text
-- | Default path for the credentials file. This looks in in the
-- HOME directory as determined by the directory library.
--
--
-- - UNIXOSX: @$HOME.aws/credentials@
-- - Windows: C:/Users//<user>.awscredentials
--
--
-- Note: This does not match the default AWS SDK location of
-- %USERPROFILE%.awscredentials on Windows. (Sorry.)
credFile :: (MonadCatch m, MonadIO m) => m FilePath
-- | Explicit access and secret keys.
fromKeys :: AccessKey -> SecretKey -> Auth
-- | A session containing the access key, secret key, and a session token.
fromSession :: AccessKey -> SecretKey -> SessionToken -> Auth
-- | Retrieve access key, secret key, and a session token from the default
-- environment variables.
--
-- Throws MissingEnvError if either of the default environment
-- variables cannot be read, but not if the session token is absent.
--
-- See: envAccessKey, envSecretKey,
-- envSessionToken
fromEnv :: (Applicative m, MonadIO m, MonadThrow m) => m Auth
-- | Retrieve access key, secret key and a session token from specific
-- environment variables.
--
-- Throws MissingEnvError if either of the specified key
-- environment variables cannot be read, but not if the session token is
-- absent.
fromEnvKeys :: (Applicative m, MonadIO m, MonadThrow m) => Text -> Text -> Maybe Text -> m Auth
-- | Loads the default credentials INI file using the default
-- profile name.
--
-- Throws MissingFileError if credFile is missing, or
-- InvalidFileError if an error occurs during parsing.
--
-- See: credProfile and credFile
fromFile :: (Applicative m, MonadIO m, MonadCatch m) => m Auth
-- | Retrieve the access, secret and session token from the specified
-- section (profile) in a valid INI credentials file.
--
-- Throws MissingFileError if the specified file is missing, or
-- InvalidFileError if an error occurs during parsing.
fromFilePath :: (Applicative m, MonadIO m, MonadCatch m) => Text -> FilePath -> m Auth
-- | Retrieve the default IAM Profile from the local EC2 instance-data.
--
-- The default IAM profile is determined by Amazon as the first profile
-- found in the response from:
-- http://169.254.169.254/latest/meta-data/iam/security-credentials/
--
-- Throws RetrievalError if the HTTP call fails, or
-- InvalidIAMError if the default IAM profile cannot be read.
fromProfile :: (MonadIO m, MonadCatch m) => Manager -> m Auth
-- | Lookup a specific IAM Profile by name from the local EC2
-- instance-data.
--
-- The resulting IONewRef wrapper + timer is designed so that multiple
-- concurrent accesses of AuthEnv from the AWS
-- environment are not required to calculate expiry and sequentially
-- queue to update it.
--
-- The forked timer ensures a singular owner and pre-emptive refresh of
-- the temporary session credentials.
--
-- A weak reference is used to ensure that the forked thread will
-- eventually terminate when Auth is no longer referenced.
--
-- Throws RetrievalError if the HTTP call fails, or
-- InvalidIAMError if the specified IAM profile cannot be read.
fromProfileName :: (MonadIO m, MonadCatch m) => Manager -> Text -> m Auth
-- | Access key credential.
newtype AccessKey :: *
AccessKey :: ByteString -> AccessKey
-- | Secret key credential.
newtype SecretKey :: *
SecretKey :: ByteString -> SecretKey
-- | A session token used by STS to temporarily authorise access to an AWS
-- resource.
newtype SessionToken :: *
SessionToken :: ByteString -> SessionToken
class AsAuthError a where _RetrievalError = _AuthError . _RetrievalError _MissingEnvError = _AuthError . _MissingEnvError _MissingFileError = _AuthError . _MissingFileError _InvalidFileError = _AuthError . _InvalidFileError _InvalidIAMError = _AuthError . _InvalidIAMError
_AuthError :: AsAuthError a => Prism' a AuthError
_RetrievalError :: AsAuthError a => Prism' a HttpException
_MissingEnvError :: AsAuthError a => Prism' a Text
_MissingFileError :: AsAuthError a => Prism' a FilePath
_InvalidFileError :: AsAuthError a => Prism' a Text
_InvalidIAMError :: AsAuthError a => Prism' a Text
-- | An error thrown when attempting to read AuthN/AuthZ information.
data AuthError
RetrievalError :: HttpException -> AuthError
MissingEnvError :: Text -> AuthError
MissingFileError :: FilePath -> AuthError
InvalidFileError :: Text -> AuthError
InvalidIAMError :: Text -> AuthError
instance Typeable AuthError
instance Eq Credentials
instance Show AuthError
instance AsAuthError AuthError
instance AsAuthError SomeException
instance ToLog AuthError
instance Exception AuthError
instance Show Credentials
instance ToLog Credentials
-- | Environment and AWS specific configuration for the AWS and
-- AWST monads.
module Network.AWS.Env
-- | Creates a new environment with a new Manager without debug
-- logging and uses getAuth to expand/discover the supplied
-- Credentials. Lenses from HasEnv can be used to further
-- configure the resulting Env.
--
-- Throws AuthError when environment variables or IAM profiles
-- cannot be read.
--
-- See: newEnvWith.
newEnv :: (Applicative m, MonadIO m, MonadCatch m) => Region -> Credentials -> m Env
-- | See: newEnv
--
-- Throws AuthError when environment variables or IAM profiles
-- cannot be read.
newEnvWith :: (Applicative m, MonadIO m, MonadCatch m) => Region -> Credentials -> Maybe Bool -> Manager -> m Env
-- | The environment containing the parameters required to make AWS
-- requests.
data Env
Env :: !Region -> !Logger -> !(Int -> HttpException -> Bool) -> !(Dual (Endo Service)) -> !Manager -> !(IORef (Maybe Bool)) -> !Auth -> Env
_envRegion :: Env -> !Region
_envLogger :: Env -> !Logger
_envRetryCheck :: Env -> !(Int -> HttpException -> Bool)
_envOverride :: Env -> !(Dual (Endo Service))
_envManager :: Env -> !Manager
_envEC2 :: Env -> !(IORef (Maybe Bool))
_envAuth :: Env -> !Auth
class HasEnv a where envRegion = environment . lens _envRegion (\ s a -> s {_envRegion = a}) envLogger = environment . lens _envLogger (\ s a -> s {_envLogger = a}) envRetryCheck = environment . lens _envRetryCheck (\ s a -> s {_envRetryCheck = a}) envOverride = environment . lens _envOverride (\ s a -> s {_envOverride = a}) envManager = environment . lens _envManager (\ s a -> s {_envManager = a}) envAuth = environment . lens _envAuth (\ s a -> s {_envAuth = a}) envEC2 = environment . to _envEC2
environment :: HasEnv a => Lens' a Env
envRegion :: HasEnv a => Lens' a Region
envLogger :: HasEnv a => Lens' a Logger
envRetryCheck :: HasEnv a => Lens' a (Int -> HttpException -> Bool)
envOverride :: HasEnv a => Lens' a (Dual (Endo Service))
envManager :: HasEnv a => Lens' a Manager
envAuth :: HasEnv a => Lens' a Auth
envEC2 :: HasEnv a => Getter a (IORef (Maybe Bool))
-- | Provide a function which will be added to the existing stack of
-- overrides applied to all service configuration.
--
-- To override a specific service, it's suggested you use either
-- configure or reconfigure with a modified version of the
-- default service, such as Network.AWS.DynamoDB.dynamoDB.
override :: HasEnv a => (Service -> Service) -> a -> a
-- | Configure a specific service. All requests belonging to the supplied
-- service will use this configuration instead of the default.
--
-- It's suggested you use a modified version of the default service, such
-- as Network.AWS.DynamoDB.dynamoDB.
--
-- See: reconfigure.
configure :: HasEnv a => Service -> a -> a
-- | Scope an action such that all requests belonging to the supplied
-- service will use this configuration instead of the default.
--
-- It's suggested you use a modified version of the default service, such
-- as Network.AWS.DynamoDB.dynamoDB.
--
-- See: configure.
reconfigure :: (MonadReader r m, HasEnv r) => Service -> m a -> m a
-- | Scope an action within the specific Region.
within :: (MonadReader r m, HasEnv r) => Region -> m a -> m a
-- | Scope an action such that any retry logic for the Service is
-- ignored and any requests will at most be sent once.
once :: (MonadReader r m, HasEnv r) => m a -> m a
-- | Scope an action such that any HTTP response will use this timeout
-- value.
--
-- Default timeouts are chosen by considering:
--
--
-- - This timeout, if set.
-- - The related Service timeout for the sent request if set.
-- (Usually 70s)
-- - The envManager timeout if set.
-- - The default ClientRequest timeout. (Approximately 30s)
--
timeout :: (MonadReader r m, HasEnv r) => Seconds -> m a -> m a
instance ToLog Env
instance HasEnv Env
-- | The AWST transformer provides the environment required to
-- perform AWS operations. The transformer is intended to be used
-- directly or embedded as a layer within a transformer stack.
--
-- Network.AWS contains an IO specialised version of
-- AWST with a typeclass to assist in automatically lifting
-- operations.
module Control.Monad.Trans.AWS
type AWST = AWST' Env
data AWST' r m a
-- | Run an AWST action with the specified environment.
runAWST :: HasEnv r => r -> AWST' r m a -> m a
-- | An alias for the constraints required to send requests, which
-- AWST implicitly fulfils.
type AWSConstraint r m = (MonadCatch m, MonadResource m, MonadReader r m, HasEnv r)
-- | Creates a new environment with a new Manager without debug
-- logging and uses getAuth to expand/discover the supplied
-- Credentials. Lenses from HasEnv can be used to further
-- configure the resulting Env.
--
-- Throws AuthError when environment variables or IAM profiles
-- cannot be read.
--
-- See: newEnvWith.
newEnv :: (Applicative m, MonadIO m, MonadCatch m) => Region -> Credentials -> m Env
-- | The environment containing the parameters required to make AWS
-- requests.
data Env
class HasEnv a where envRegion = environment . lens _envRegion (\ s a -> s {_envRegion = a}) envLogger = environment . lens _envLogger (\ s a -> s {_envLogger = a}) envRetryCheck = environment . lens _envRetryCheck (\ s a -> s {_envRetryCheck = a}) envOverride = environment . lens _envOverride (\ s a -> s {_envOverride = a}) envManager = environment . lens _envManager (\ s a -> s {_envManager = a}) envAuth = environment . lens _envAuth (\ s a -> s {_envAuth = a}) envEC2 = environment . to _envEC2
environment :: HasEnv a => Lens' a Env
envRegion :: HasEnv a => Lens' a Region
envLogger :: HasEnv a => Lens' a Logger
envRetryCheck :: HasEnv a => Lens' a (Int -> HttpException -> Bool)
envOverride :: HasEnv a => Lens' a (Dual (Endo Service))
envManager :: HasEnv a => Lens' a Manager
envAuth :: HasEnv a => Lens' a Auth
envEC2 :: HasEnv a => Getter a (IORef (Maybe Bool))
-- | Determines how AuthN/AuthZ information is retrieved.
data Credentials
-- | Explicit access and secret keys. See fromKeys.
FromKeys :: AccessKey -> SecretKey -> Credentials
-- | Explicit access key, secret key and a session token. See
-- fromSession.
FromSession :: AccessKey -> SecretKey -> SessionToken -> Credentials
-- | Lookup specific environment variables for access key, secret key, and
-- an optional session token respectively.
FromEnv :: Text -> Text -> (Maybe Text) -> Credentials
-- | 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.
FromProfile :: Text -> Credentials
-- | A credentials profile name (the INI section) and the path to the AWS
-- credentials file.
FromFile :: Text -> FilePath -> Credentials
-- | Attempt to credentials discovery via the following steps:
--
--
-- - Read the envAccessKey and envSecretKey from the
-- environment if they are set.
-- - Read the credentials file if credFile exists.
-- - Retrieve the first available IAM profile 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.
Discover :: Credentials
-- | The sum of available AWS regions.
data Region :: *
-- | Europe / eu-west-1
Ireland :: Region
-- | Europe / eu-central-1
Frankfurt :: Region
-- | Asia Pacific / ap-northeast-1
Tokyo :: Region
-- | Asia Pacific / ap-southeast-1
Singapore :: Region
-- | Asia Pacific / ap-southeast-2
Sydney :: Region
-- | China / cn-north-1
Beijing :: Region
-- | US / us-east-1
NorthVirginia :: Region
-- | US / us-west-1
NorthCalifornia :: Region
-- | US / us-west-2
Oregon :: Region
-- | AWS GovCloud / us-gov-west-1
GovCloud :: Region
-- | AWS GovCloud (FIPS 140-2) S3 Only / fips-us-gov-west-1
GovCloudFIPS :: Region
-- | South America / sa-east-1
SaoPaulo :: Region
-- | Send a request, returning the associated response if successful.
--
-- Throws Error.
send :: (AWSConstraint r m, AWSRequest a) => a -> m (Rs a)
-- | Repeatedly send a request, automatically setting markers and
-- paginating over multiple responses while available.
--
-- Throws Error.
paginate :: (AWSConstraint r m, AWSPager a) => a -> Source m (Rs a)
-- | Poll the API with the supplied request until a specific Wait
-- condition is fulfilled.
--
-- Throws Error.
await :: (AWSConstraint r m, AWSRequest a) => Wait a -> a -> m ()
-- | Configure a specific service. All requests belonging to the supplied
-- service will use this configuration instead of the default.
--
-- It's suggested you use a modified version of the default service, such
-- as Network.AWS.DynamoDB.dynamoDB.
--
-- See: reconfigure.
configure :: HasEnv a => Service -> a -> a
-- | Provide a function which will be added to the existing stack of
-- overrides applied to all service configuration.
--
-- To override a specific service, it's suggested you use either
-- configure or reconfigure with a modified version of the
-- default service, such as Network.AWS.DynamoDB.dynamoDB.
override :: HasEnv a => (Service -> Service) -> a -> a
-- | Scope an action such that all requests belonging to the supplied
-- service will use this configuration instead of the default.
--
-- It's suggested you use a modified version of the default service, such
-- as Network.AWS.DynamoDB.dynamoDB.
--
-- See: configure.
reconfigure :: (MonadReader r m, HasEnv r) => Service -> m a -> m a
-- | Scope an action within the specific Region.
within :: (MonadReader r m, HasEnv r) => Region -> m a -> m a
-- | Scope an action such that any retry logic for the Service is
-- ignored and any requests will at most be sent once.
once :: (MonadReader r m, HasEnv r) => m a -> m a
-- | Scope an action such that any HTTP response will use this timeout
-- value.
--
-- Default timeouts are chosen by considering:
--
--
-- - This timeout, if set.
-- - The related Service timeout for the sent request if set.
-- (Usually 70s)
-- - The envManager timeout if set.
-- - The default ClientRequest timeout. (Approximately 30s)
--
timeout :: (MonadReader r m, HasEnv r) => Seconds -> m a -> m a
-- | Anything that can be safely converted to a HashedBody.
class ToHashedBody a
toHashed :: ToHashedBody a => a -> HashedBody
-- | Construct a HashedBody from a FilePath, calculating the
-- SHA256 hash and file size.
--
-- Note: While this function will perform in constant space, it
-- will enumerate the entirety of the file contents _twice_. Firstly to
-- calculate the SHA256 and lastly to stream the contents to the socket
-- during sending.
--
-- See: ToHashedBody.
hashedFile :: MonadIO m => FilePath -> m HashedBody
-- | Construct a HashedBody from a source, manually specifying the
-- SHA256 hash and file size.
--
-- See: ToHashedBody.
hashedBody :: Digest SHA256 -> Integer -> Source (ResourceT IO) ByteString -> HashedBody
-- | Anything that can be converted to a streaming request Body.
class ToBody a
toBody :: ToBody a => a -> RqBody
-- | Specifies the transmitted size of the 'Transfer-Encoding' chunks.
--
-- See: defaultChunk.
newtype ChunkSize :: *
ChunkSize :: Int -> ChunkSize
-- | The default chunk size of 128 KB. The minimum chunk size accepted by
-- AWS is 8 KB, unless the entirety of the request is below this
-- threshold.
--
-- A chunk size of 64 KB or higher is recommended for performance
-- reasons.
defaultChunkSize :: ChunkSize
-- | Something something.
--
-- Will intelligently revert to HashedBody if the file is smaller
-- than the specified ChunkSize.
--
-- Add note about how it selects chunk size.
--
-- See: ToBody.
chunkedFile :: MonadIO m => ChunkSize -> FilePath -> m RqBody
-- | Something something.
--
-- Marked as unsafe because it does nothing to enforce the chunk size.
-- Typically for conduit IO functions, it's whatever ByteString's
-- defaultBufferSize is, around 32 KB. If the chunk size is less
-- than 8 KB, the request will error. 64 KB or higher chunk size is
-- recommended for performance reasons.
--
-- Note that it will always create a chunked body even if the request is
-- too small.
--
-- See: ToBody.
unsafeChunkedBody :: ChunkSize -> Integer -> Source (ResourceT IO) ByteString -> RqBody
-- | Connect a Sink to a response stream.
sinkBody :: MonadResource m => RsBody -> Sink ByteString m a -> m a
-- | Convenience function for obtaining the size of a file.
getFileSize :: MonadIO m => FilePath -> m Integer
-- | Incrementally calculate a MD5 Digest.
sinkMD5 :: Monad m => Consumer ByteString m (Digest MD5)
-- | Incrementally calculate a SHA256 Digest.
sinkSHA256 :: Monad m => Consumer ByteString m (Digest SHA256)
-- | Presign an URL that is valid from the specified time until the number
-- of seconds expiry has elapsed.
presignURL :: (MonadIO m, MonadReader r m, HasEnv r, AWSRequest a) => UTCTime -> Seconds -> a -> m ByteString
-- | Presign an HTTP request that is valid from the specified time until
-- the number of seconds expiry has elapsed.
presign :: (MonadIO m, MonadReader r m, HasEnv r, AWSRequest a) => UTCTime -> Seconds -> a -> m ClientRequest
-- | Test whether the underlying host is running on EC2. This is memoised
-- and any external check occurs for the first invocation only.
isEC2 :: (MonadIO m, MonadReader r m, HasEnv r) => m Bool
-- | Retrieve the specified Dynamic data.
--
-- Throws HttpException.
dynamic :: (MonadIO m, MonadThrow m, MonadReader r m, HasEnv r) => Dynamic -> m ByteString
-- | Retrieve the specified Metadata.
--
-- Throws HttpException.
metadata :: (MonadIO m, MonadThrow m, MonadReader r m, HasEnv r) => Metadata -> m ByteString
-- | Retrieve the user data. Returns Nothing if no user data is
-- assigned to the instance.
--
-- Throws HttpException.
userdata :: (MonadIO m, MonadCatch m, MonadReader r m, HasEnv r) => m (Maybe ByteString)
data Dynamic
-- | Value showing whether the customer has enabled detailed one-minute
-- monitoring in CloudWatch.
--
-- Valid values: enabled | disabled.
FWS :: Dynamic
-- | JSON containing instance attributes, such as instance-id, private IP
-- address, etc.
Document :: Dynamic
-- | Used to verify the document's authenticity and content against the
-- signature.
PKCS7 :: Dynamic
Signature :: Dynamic
data Metadata
-- | The AMI ID used to launch the instance.
AMIId :: Metadata
-- | If you started more than one instance at the same time, this value
-- indicates the order in which the instance was launched. The value of
-- the first instance launched is 0.
AMILaunchIndex :: Metadata
-- | The path to the AMI's manifest file in Amazon S3. If you used an
-- Amazon EBS-backed AMI to launch the instance, the returned result is
-- unknown.
AMIManifestPath :: Metadata
-- | The AMI IDs of any instances that were rebundled to create this AMI.
-- This value will only exist if the AMI manifest file contained an
-- ancestor-amis key.
AncestorAMIIds :: Metadata
-- | See: Mapping
BlockDevice :: !Mapping -> Metadata
-- | The private hostname of the instance. In cases where multiple network
-- interfaces are present, this refers to the eth0 device (the device for
-- which the device number is 0).
Hostname :: Metadata
-- | See: Info
IAM :: !Info -> Metadata
-- | Notifies the instance that it should reboot in preparation for
-- bundling. Valid values: none | shutdown | bundle-pending.
InstanceAction :: Metadata
-- | The ID of this instance.
InstanceId :: Metadata
-- | The type of instance.
--
-- See: InstanceType
InstanceType :: Metadata
-- | The ID of the kernel launched with this instance, if applicable.
KernelId :: Metadata
-- | The private DNS hostname of the instance. In cases where multiple
-- network interfaces are present, this refers to the eth0 device (the
-- device for which the device number is 0).
LocalHostname :: Metadata
-- | The private IP address of the instance. In cases where multiple
-- network interfaces are present, this refers to the eth0 device (the
-- device for which the device number is 0).
LocalIPV4 :: Metadata
-- | The instance's media access control (MAC) address. In cases where
-- multiple network interfaces are present, this refers to the eth0
-- device (the device for which the device number is 0).
MAC :: Metadata
-- | See: Interface
Network :: !Text -> !Interface -> Metadata
-- | The Availability Zone in which the instance launched.
AvailabilityZone :: Metadata
-- | Product codes associated with the instance, if any.
ProductCodes :: Metadata
-- | The instance's public DNS. If the instance is in a VPC, this category
-- is only returned if the enableDnsHostnames attribute is set to true.
-- For more information, see Using DNS with Your VPC.
PublicHostname :: Metadata
-- | The public IP address. If an Elastic IP address is associated with the
-- instance, the value returned is the Elastic IP address.
PublicIPV4 :: Metadata
-- | Public key. Only available if supplied at instance launch time.
OpenSSHKey :: Metadata
-- | The ID of the RAM disk specified at launch time, if applicable.
RAMDiskId :: Metadata
-- | ID of the reservation.
ReservationId :: Metadata
-- | The names of the security groups applied to the instance.
SecurityGroups :: Metadata
class AsError a
_Error :: AsError a => Prism' a Error
_TransportError :: AsError a => Prism' a HttpException
_SerializeError :: AsError a => Prism' a SerializeError
_ServiceError :: AsError a => Prism' a ServiceError
class AsAuthError a where _RetrievalError = _AuthError . _RetrievalError _MissingEnvError = _AuthError . _MissingEnvError _MissingFileError = _AuthError . _MissingFileError _InvalidFileError = _AuthError . _InvalidFileError _InvalidIAMError = _AuthError . _InvalidIAMError
_AuthError :: AsAuthError a => Prism' a AuthError
_RetrievalError :: AsAuthError a => Prism' a HttpException
_MissingEnvError :: AsAuthError a => Prism' a Text
_MissingFileError :: AsAuthError a => Prism' a FilePath
_InvalidFileError :: AsAuthError a => Prism' a Text
_InvalidIAMError :: AsAuthError a => Prism' a Text
-- | A variant of try that takes a Prism (or any Fold)
-- to select which exceptions are caught (c.f. tryJust,
-- catchJust). If the Exception does not match the
-- predicate, it is re-thrown.
--
--
-- trying :: MonadCatch m => Prism' SomeException a -> m r -> m (Either a r)
-- trying :: MonadCatch m => Lens' SomeException a -> m r -> m (Either a r)
-- trying :: MonadCatch m => Traversal' SomeException a -> m r -> m (Either a r)
-- trying :: MonadCatch m => Iso' SomeException a -> m r -> m (Either a r)
-- trying :: MonadCatch m => Getter SomeException a -> m r -> m (Either a r)
-- trying :: MonadCatch m => Fold SomeException a -> m r -> m (Either a r)
--
trying :: MonadCatch m => Getting (First a) SomeException a -> m r -> m (Either a r)
-- | Catch exceptions that match a given Prism (or any Fold,
-- really).
--
--
-- >>> catching _AssertionFailed (assert False (return "uncaught")) $ \ _ -> return "caught"
-- "caught"
--
--
--
-- catching :: MonadCatch m => Prism' SomeException a -> m r -> (a -> m r) -> m r
-- catching :: MonadCatch m => Lens' SomeException a -> m r -> (a -> m r) -> m r
-- catching :: MonadCatch m => Traversal' SomeException a -> m r -> (a -> m r) -> m r
-- catching :: MonadCatch m => Iso' SomeException a -> m r -> (a -> m r) -> m r
-- catching :: MonadCatch m => Getter SomeException a -> m r -> (a -> m r) -> m r
-- catching :: MonadCatch m => Fold SomeException a -> m r -> (a -> m r) -> m r
--
catching :: MonadCatch m => Getting (First a) SomeException a -> m r -> (a -> m r) -> m r
-- | A function threaded through various request and serialisation routines
-- to log informational and debug messages.
type Logger = LogLevel -> Builder -> IO ()
data LogLevel :: *
-- | Info messages supplied by the user - this level is not emitted by the
-- library.
Info :: LogLevel
-- | Error messages only.
Error :: LogLevel
-- | Useful debug information + info + error levels.
Debug :: LogLevel
-- | Includes potentially sensitive signing metadata, and non-streaming
-- response bodies.
Trace :: LogLevel
-- | This is a primitive logger which can be used to log builds to a
-- Handle.
--
-- Note: A more sophisticated logging library such as
-- tinylog or fast-logger should be used in production
-- code.
newLogger :: MonadIO m => LogLevel -> Handle -> m Logger
data Endpoint :: *
Endpoint :: ByteString -> SrictNotUnpackedBool -> SrictNotUnpackedInt -> ByteString -> Endpoint
_endpointHost :: Endpoint -> ByteString
_endpointSecure :: Endpoint -> SrictNotUnpackedBool
_endpointPort :: Endpoint -> SrictNotUnpackedInt
_endpointScope :: Endpoint -> ByteString
-- | A convenience function for overriding the Service
-- Endpoint.
--
-- See: serviceEndpoint.
setEndpoint :: Bool -> ByteString -> Int -> Service -> Service
-- | Invariant: only services that support _both_ standard and chunked
-- signing expose RqBody as a parameter.
data RqBody :: *
-- | An opaque request body containing a SHA256 hash.
data HashedBody :: *
-- | An opaque request body which will be transmitted via
-- Transfer-Encoding: chunked.
--
-- Invariant: Only services that support chunked encoding can
-- accept a ChunkedBody. (Currently S3.) This is enforced by the
-- type signatures emitted by the generator.
data ChunkedBody :: *
-- | A streaming, exception safe response body.
data RsBody :: *
-- | Unwrap a ResourceT transformer, and call all registered release
-- actions.
--
-- Note that there is some reference counting involved due to
-- resourceForkIO. If multiple threads are sharing the same
-- collection of resources, only the last call to runResourceT
-- will deallocate the resources.
--
-- Since 0.3.0
runResourceT :: MonadBaseControl IO m => ResourceT m a -> m a
instance Functor m => Functor (AWST' r m)
instance Applicative m => Applicative (AWST' r m)
instance Alternative m => Alternative (AWST' r m)
instance Monad m => Monad (AWST' r m)
instance MonadPlus m => MonadPlus (AWST' r m)
instance MonadIO m => MonadIO (AWST' r m)
instance MonadActive m => MonadActive (AWST' r m)
instance MonadTrans (AWST' r)
instance MFunctor (AWST' r)
instance MonadState s m => MonadState s (AWST' r m)
instance MonadWriter w m => MonadWriter w (AWST' r m)
instance Monad m => MonadReader r (AWST' r m)
instance MonadError e m => MonadError e (AWST' r m)
instance MonadResource m => MonadResource (AWST' r m)
instance MonadBaseControl b m => MonadBaseControl b (AWST' r m)
instance MonadTransControl (AWST' r)
instance MonadBase b m => MonadBase b (AWST' r m)
instance MonadMask m => MonadMask (AWST' r m)
instance MonadCatch m => MonadCatch (AWST' r m)
instance MonadThrow m => MonadThrow (AWST' r m)
-- | This module provides a simple AWS monad and a set of operations
-- which can be performed against remote Amazon Web Services APIs, for
-- use with the types supplied by the various amazonka-*
-- libraries.
--
-- A MonadAWS typeclass is used as a function constraint to
-- provide automatic lifting of functions when embedding AWS as a
-- layer inside your own application stack.
--
-- Control.Monad.Trans.AWS contains the underlying AWST
-- transformer.
module Network.AWS
-- | A specialisation of the AWST transformer.
type AWS = AWST (ResourceT IO)
-- | Monads in which AWS actions may be embedded.
class (Functor m, Applicative m, Monad m, MonadIO m, MonadCatch m) => MonadAWS m
liftAWS :: MonadAWS m => AWS a -> m a
-- | Run the AWS monad. Any outstanding HTTP responses'
-- ResumableSource will be closed when the ResourceT
-- computation is unwrapped with runResourceT.
--
-- Throws Error, which will include HTTPExceptions,
-- serialisation errors, or any particular errors returned by the
-- respective AWS service.
--
-- See: runAWST, runResourceT.
runAWS :: (MonadResource m, HasEnv r) => r -> AWS a -> m a
-- | Creates a new environment with a new Manager without debug
-- logging and uses getAuth to expand/discover the supplied
-- Credentials. Lenses from HasEnv can be used to further
-- configure the resulting Env.
--
-- Throws AuthError when environment variables or IAM profiles
-- cannot be read.
--
-- See: newEnvWith.
newEnv :: (Applicative m, MonadIO m, MonadCatch m) => Region -> Credentials -> m Env
-- | The environment containing the parameters required to make AWS
-- requests.
data Env
class HasEnv a where envRegion = environment . lens _envRegion (\ s a -> s {_envRegion = a}) envLogger = environment . lens _envLogger (\ s a -> s {_envLogger = a}) envRetryCheck = environment . lens _envRetryCheck (\ s a -> s {_envRetryCheck = a}) envOverride = environment . lens _envOverride (\ s a -> s {_envOverride = a}) envManager = environment . lens _envManager (\ s a -> s {_envManager = a}) envAuth = environment . lens _envAuth (\ s a -> s {_envAuth = a}) envEC2 = environment . to _envEC2
environment :: HasEnv a => Lens' a Env
envRegion :: HasEnv a => Lens' a Region
envLogger :: HasEnv a => Lens' a Logger
envRetryCheck :: HasEnv a => Lens' a (Int -> HttpException -> Bool)
envOverride :: HasEnv a => Lens' a (Dual (Endo Service))
envManager :: HasEnv a => Lens' a Manager
envAuth :: HasEnv a => Lens' a Auth
envEC2 :: HasEnv a => Getter a (IORef (Maybe Bool))
-- | Determines how AuthN/AuthZ information is retrieved.
data Credentials
-- | Explicit access and secret keys. See fromKeys.
FromKeys :: AccessKey -> SecretKey -> Credentials
-- | Explicit access key, secret key and a session token. See
-- fromSession.
FromSession :: AccessKey -> SecretKey -> SessionToken -> Credentials
-- | Lookup specific environment variables for access key, secret key, and
-- an optional session token respectively.
FromEnv :: Text -> Text -> (Maybe Text) -> Credentials
-- | 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.
FromProfile :: Text -> Credentials
-- | A credentials profile name (the INI section) and the path to the AWS
-- credentials file.
FromFile :: Text -> FilePath -> Credentials
-- | Attempt to credentials discovery via the following steps:
--
--
-- - Read the envAccessKey and envSecretKey from the
-- environment if they are set.
-- - Read the credentials file if credFile exists.
-- - Retrieve the first available IAM profile 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.
Discover :: Credentials
-- | The sum of available AWS regions.
data Region :: *
-- | Europe / eu-west-1
Ireland :: Region
-- | Europe / eu-central-1
Frankfurt :: Region
-- | Asia Pacific / ap-northeast-1
Tokyo :: Region
-- | Asia Pacific / ap-southeast-1
Singapore :: Region
-- | Asia Pacific / ap-southeast-2
Sydney :: Region
-- | China / cn-north-1
Beijing :: Region
-- | US / us-east-1
NorthVirginia :: Region
-- | US / us-west-1
NorthCalifornia :: Region
-- | US / us-west-2
Oregon :: Region
-- | AWS GovCloud / us-gov-west-1
GovCloud :: Region
-- | AWS GovCloud (FIPS 140-2) S3 Only / fips-us-gov-west-1
GovCloudFIPS :: Region
-- | South America / sa-east-1
SaoPaulo :: Region
-- | Send a request, returning the associated response if successful.
send :: (MonadAWS m, AWSRequest a) => a -> m (Rs a)
-- | Repeatedly send a request, automatically setting markers and
-- paginating over multiple responses while available.
paginate :: (MonadAWS m, AWSPager a) => a -> Source m (Rs a)
-- | Poll the API with the supplied request until a specific Wait
-- condition is fulfilled.
await :: (MonadAWS m, AWSRequest a) => Wait a -> a -> m ()
-- | Configure a specific service. All requests belonging to the supplied
-- service will use this configuration instead of the default.
--
-- It's suggested you use a modified version of the default service, such
-- as Network.AWS.DynamoDB.dynamoDB.
--
-- See: reconfigure.
configure :: HasEnv a => Service -> a -> a
-- | Provide a function which will be added to the existing stack of
-- overrides applied to all service configuration.
--
-- To override a specific service, it's suggested you use either
-- configure or reconfigure with a modified version of the
-- default service, such as Network.AWS.DynamoDB.dynamoDB.
override :: HasEnv a => (Service -> Service) -> a -> a
-- | Scope an action such that all requests belonging to the supplied
-- service will use this configuration instead of the default.
--
-- It's suggested you use a modified version of the default service, such
-- as Network.AWS.DynamoDB.dynamoDB.
--
-- See: configure.
reconfigure :: MonadAWS m => Service -> AWS a -> m a
-- | Scope an action within the specific Region.
within :: MonadAWS m => Region -> AWS a -> m a
-- | Scope an action such that any retry logic for the Service is
-- ignored and any requests will at most be sent once.
once :: MonadAWS m => AWS a -> m a
-- | Scope an action such that any HTTP response will use this timeout
-- value.
timeout :: MonadAWS m => Seconds -> AWS a -> m a
-- | Anything that can be safely converted to a HashedBody.
class ToHashedBody a
toHashed :: ToHashedBody a => a -> HashedBody
-- | Construct a HashedBody from a FilePath, calculating the
-- SHA256 hash and file size.
--
-- Note: While this function will perform in constant space, it
-- will enumerate the entirety of the file contents _twice_. Firstly to
-- calculate the SHA256 and lastly to stream the contents to the socket
-- during sending.
--
-- See: ToHashedBody.
hashedFile :: MonadIO m => FilePath -> m HashedBody
-- | Construct a HashedBody from a source, manually specifying the
-- SHA256 hash and file size.
--
-- See: ToHashedBody.
hashedBody :: Digest SHA256 -> Integer -> Source (ResourceT IO) ByteString -> HashedBody
-- | Anything that can be converted to a streaming request Body.
class ToBody a
toBody :: ToBody a => a -> RqBody
-- | Specifies the transmitted size of the 'Transfer-Encoding' chunks.
--
-- See: defaultChunk.
newtype ChunkSize :: *
ChunkSize :: Int -> ChunkSize
-- | The default chunk size of 128 KB. The minimum chunk size accepted by
-- AWS is 8 KB, unless the entirety of the request is below this
-- threshold.
--
-- A chunk size of 64 KB or higher is recommended for performance
-- reasons.
defaultChunkSize :: ChunkSize
-- | Something something.
--
-- Will intelligently revert to HashedBody if the file is smaller
-- than the specified ChunkSize.
--
-- Add note about how it selects chunk size.
--
-- See: ToBody.
chunkedFile :: MonadIO m => ChunkSize -> FilePath -> m RqBody
-- | Something something.
--
-- Marked as unsafe because it does nothing to enforce the chunk size.
-- Typically for conduit IO functions, it's whatever ByteString's
-- defaultBufferSize is, around 32 KB. If the chunk size is less
-- than 8 KB, the request will error. 64 KB or higher chunk size is
-- recommended for performance reasons.
--
-- Note that it will always create a chunked body even if the request is
-- too small.
--
-- See: ToBody.
unsafeChunkedBody :: ChunkSize -> Integer -> Source (ResourceT IO) ByteString -> RqBody
-- | Connect a Sink to a response stream.
sinkBody :: MonadResource m => RsBody -> Sink ByteString m a -> m a
-- | Convenience function for obtaining the size of a file.
getFileSize :: MonadIO m => FilePath -> m Integer
-- | Incrementally calculate a MD5 Digest.
sinkMD5 :: Monad m => Consumer ByteString m (Digest MD5)
-- | Incrementally calculate a SHA256 Digest.
sinkSHA256 :: Monad m => Consumer ByteString m (Digest SHA256)
-- | Presign an URL that is valid from the specified time until the number
-- of seconds expiry has elapsed.
presignURL :: (MonadAWS m, AWSRequest a) => UTCTime -> Seconds -> a -> m ByteString
-- | Test whether the underlying host is running on EC2. This is memoised
-- and an HTTP request is made to the host's metadata endpoint for the
-- first call only.
isEC2 :: MonadAWS m => m Bool
-- | Retrieve the specified Dynamic data.
dynamic :: MonadAWS m => Dynamic -> m ByteString
-- | Retrieve the specified Metadata.
metadata :: MonadAWS m => Metadata -> m ByteString
-- | Retrieve the user data. Returns Nothing if no user data is
-- assigned to the instance.
userdata :: MonadAWS m => m (Maybe ByteString)
data Dynamic
-- | Value showing whether the customer has enabled detailed one-minute
-- monitoring in CloudWatch.
--
-- Valid values: enabled | disabled.
FWS :: Dynamic
-- | JSON containing instance attributes, such as instance-id, private IP
-- address, etc.
Document :: Dynamic
-- | Used to verify the document's authenticity and content against the
-- signature.
PKCS7 :: Dynamic
Signature :: Dynamic
data Metadata
-- | The AMI ID used to launch the instance.
AMIId :: Metadata
-- | If you started more than one instance at the same time, this value
-- indicates the order in which the instance was launched. The value of
-- the first instance launched is 0.
AMILaunchIndex :: Metadata
-- | The path to the AMI's manifest file in Amazon S3. If you used an
-- Amazon EBS-backed AMI to launch the instance, the returned result is
-- unknown.
AMIManifestPath :: Metadata
-- | The AMI IDs of any instances that were rebundled to create this AMI.
-- This value will only exist if the AMI manifest file contained an
-- ancestor-amis key.
AncestorAMIIds :: Metadata
-- | See: Mapping
BlockDevice :: !Mapping -> Metadata
-- | The private hostname of the instance. In cases where multiple network
-- interfaces are present, this refers to the eth0 device (the device for
-- which the device number is 0).
Hostname :: Metadata
-- | See: Info
IAM :: !Info -> Metadata
-- | Notifies the instance that it should reboot in preparation for
-- bundling. Valid values: none | shutdown | bundle-pending.
InstanceAction :: Metadata
-- | The ID of this instance.
InstanceId :: Metadata
-- | The type of instance.
--
-- See: InstanceType
InstanceType :: Metadata
-- | The ID of the kernel launched with this instance, if applicable.
KernelId :: Metadata
-- | The private DNS hostname of the instance. In cases where multiple
-- network interfaces are present, this refers to the eth0 device (the
-- device for which the device number is 0).
LocalHostname :: Metadata
-- | The private IP address of the instance. In cases where multiple
-- network interfaces are present, this refers to the eth0 device (the
-- device for which the device number is 0).
LocalIPV4 :: Metadata
-- | The instance's media access control (MAC) address. In cases where
-- multiple network interfaces are present, this refers to the eth0
-- device (the device for which the device number is 0).
MAC :: Metadata
-- | See: Interface
Network :: !Text -> !Interface -> Metadata
-- | The Availability Zone in which the instance launched.
AvailabilityZone :: Metadata
-- | Product codes associated with the instance, if any.
ProductCodes :: Metadata
-- | The instance's public DNS. If the instance is in a VPC, this category
-- is only returned if the enableDnsHostnames attribute is set to true.
-- For more information, see Using DNS with Your VPC.
PublicHostname :: Metadata
-- | The public IP address. If an Elastic IP address is associated with the
-- instance, the value returned is the Elastic IP address.
PublicIPV4 :: Metadata
-- | Public key. Only available if supplied at instance launch time.
OpenSSHKey :: Metadata
-- | The ID of the RAM disk specified at launch time, if applicable.
RAMDiskId :: Metadata
-- | ID of the reservation.
ReservationId :: Metadata
-- | The names of the security groups applied to the instance.
SecurityGroups :: Metadata
class AsError a
_Error :: AsError a => Prism' a Error
_TransportError :: AsError a => Prism' a HttpException
_SerializeError :: AsError a => Prism' a SerializeError
_ServiceError :: AsError a => Prism' a ServiceError
class AsAuthError a where _RetrievalError = _AuthError . _RetrievalError _MissingEnvError = _AuthError . _MissingEnvError _MissingFileError = _AuthError . _MissingFileError _InvalidFileError = _AuthError . _InvalidFileError _InvalidIAMError = _AuthError . _InvalidIAMError
_AuthError :: AsAuthError a => Prism' a AuthError
_RetrievalError :: AsAuthError a => Prism' a HttpException
_MissingEnvError :: AsAuthError a => Prism' a Text
_MissingFileError :: AsAuthError a => Prism' a FilePath
_InvalidFileError :: AsAuthError a => Prism' a Text
_InvalidIAMError :: AsAuthError a => Prism' a Text
-- | A variant of try that takes a Prism (or any Fold)
-- to select which exceptions are caught (c.f. tryJust,
-- catchJust). If the Exception does not match the
-- predicate, it is re-thrown.
--
--
-- trying :: MonadCatch m => Prism' SomeException a -> m r -> m (Either a r)
-- trying :: MonadCatch m => Lens' SomeException a -> m r -> m (Either a r)
-- trying :: MonadCatch m => Traversal' SomeException a -> m r -> m (Either a r)
-- trying :: MonadCatch m => Iso' SomeException a -> m r -> m (Either a r)
-- trying :: MonadCatch m => Getter SomeException a -> m r -> m (Either a r)
-- trying :: MonadCatch m => Fold SomeException a -> m r -> m (Either a r)
--
trying :: MonadCatch m => Getting (First a) SomeException a -> m r -> m (Either a r)
-- | Catch exceptions that match a given Prism (or any Fold,
-- really).
--
--
-- >>> catching _AssertionFailed (assert False (return "uncaught")) $ \ _ -> return "caught"
-- "caught"
--
--
--
-- catching :: MonadCatch m => Prism' SomeException a -> m r -> (a -> m r) -> m r
-- catching :: MonadCatch m => Lens' SomeException a -> m r -> (a -> m r) -> m r
-- catching :: MonadCatch m => Traversal' SomeException a -> m r -> (a -> m r) -> m r
-- catching :: MonadCatch m => Iso' SomeException a -> m r -> (a -> m r) -> m r
-- catching :: MonadCatch m => Getter SomeException a -> m r -> (a -> m r) -> m r
-- catching :: MonadCatch m => Fold SomeException a -> m r -> (a -> m r) -> m r
--
catching :: MonadCatch m => Getting (First a) SomeException a -> m r -> (a -> m r) -> m r
-- | A function threaded through various request and serialisation routines
-- to log informational and debug messages.
type Logger = LogLevel -> Builder -> IO ()
data LogLevel :: *
-- | Info messages supplied by the user - this level is not emitted by the
-- library.
Info :: LogLevel
-- | Error messages only.
Error :: LogLevel
-- | Useful debug information + info + error levels.
Debug :: LogLevel
-- | Includes potentially sensitive signing metadata, and non-streaming
-- response bodies.
Trace :: LogLevel
-- | This is a primitive logger which can be used to log builds to a
-- Handle.
--
-- Note: A more sophisticated logging library such as
-- tinylog or fast-logger should be used in production
-- code.
newLogger :: MonadIO m => LogLevel -> Handle -> m Logger
data Endpoint :: *
Endpoint :: ByteString -> SrictNotUnpackedBool -> SrictNotUnpackedInt -> ByteString -> Endpoint
_endpointHost :: Endpoint -> ByteString
_endpointSecure :: Endpoint -> SrictNotUnpackedBool
_endpointPort :: Endpoint -> SrictNotUnpackedInt
_endpointScope :: Endpoint -> ByteString
-- | A convenience function for overriding the Service
-- Endpoint.
--
-- See: serviceEndpoint.
setEndpoint :: Bool -> ByteString -> Int -> Service -> Service
-- | Invariant: only services that support _both_ standard and chunked
-- signing expose RqBody as a parameter.
data RqBody :: *
-- | An opaque request body containing a SHA256 hash.
data HashedBody :: *
-- | An opaque request body which will be transmitted via
-- Transfer-Encoding: chunked.
--
-- Invariant: Only services that support chunked encoding can
-- accept a ChunkedBody. (Currently S3.) This is enforced by the
-- type signatures emitted by the generator.
data ChunkedBody :: *
-- | A streaming, exception safe response body.
data RsBody :: *
-- | Unwrap a ResourceT transformer, and call all registered release
-- actions.
--
-- Note that there is some reference counting involved due to
-- resourceForkIO. If multiple threads are sharing the same
-- collection of resources, only the last call to runResourceT
-- will deallocate the resources.
--
-- Since 0.3.0
runResourceT :: MonadBaseControl IO m => ResourceT m a -> m a
instance (Monoid w, MonadAWS m) => MonadAWS (RWST r w s m)
instance (Monoid w, MonadAWS m) => MonadAWS (RWST r w s m)
instance (Monoid w, MonadAWS m) => MonadAWS (WriterT w m)
instance (Monoid w, MonadAWS m) => MonadAWS (WriterT w m)
instance MonadAWS m => MonadAWS (StateT s m)
instance MonadAWS m => MonadAWS (StateT s m)
instance MonadAWS m => MonadAWS (ReaderT r m)
instance MonadAWS m => MonadAWS (ExceptT e m)
instance MonadAWS m => MonadAWS (MaybeT m)
instance MonadAWS m => MonadAWS (ListT m)
instance MonadAWS m => MonadAWS (IdentityT m)
instance MonadAWS AWS