-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/
-- | Comprehensive Amazon Web Services SDK
--
@package amazonka
@version 0.2.3
-- | Retrieve an EC2 instance's local metadata.
module Network.AWS.EC2.Metadata
-- | Test whether the host is running on EC2 by requesting the
-- instance-data.
isEC2 :: Manager -> IO Bool
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
dynamic :: MonadIO m => Manager -> Dynamic -> ExceptT HttpException m ByteString
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
metadata :: MonadIO m => Manager -> Metadata -> ExceptT HttpException m ByteString
userdata :: MonadIO m => Manager -> ExceptT HttpException m (Maybe ByteString)
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 ToPath Info
instance ToPath Interface
instance ToPath Mapping
instance ToPath Metadata
instance ToPath Dynamic
-- | The core module for making requests to the various AWS services.
module Network.AWS
-- | 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.
--
-- Note: Requests will be retried depending upon each service's
-- respective strategy. This can be overriden using envRetry.
-- Requests which contain streaming request bodies (such as S3's
-- PutObject) are never considered for retries.
send :: (MonadCatch m, MonadResource m, AWSRequest a) => Env -> a -> m (Response a)
-- | 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.
paginate :: (MonadCatch m, MonadResource m, AWSPager a) => Env -> a -> Source m (Response a)
-- | Poll the API until a predefined condition is fulfilled using the
-- supplied Wait specification from the respective service.
--
-- The response will be either the first error returned that is not
-- handled by the specification, or the successful response from the
-- await request.
--
-- Note: You can find any available Wait specifications
-- under then Network.AWS.ServiceName.Waiters namespace
-- for supported services.
await :: (MonadCatch m, MonadResource m, AWSRequest a) => Env -> Wait a -> a -> m (Response a)
-- | Presign an HTTP request that expires at the specified amount of time
-- in the future.
--
-- Note: Requires the service's signer to be an instance of
-- AWSPresigner. Not all signing process support this.
presign :: (MonadIO m, AWSRequest a, AWSPresigner (Sg (Sv a))) => Env -> a -> UTCTime -> Integer -> m Request
-- | Presign a URL that expires at the specified amount of time in the
-- future.
--
-- See: presign
presignURL :: (MonadIO m, AWSRequest a, AWSPresigner (Sg (Sv a))) => Env -> a -> UTCTime -> Integer -> m ByteString
-- | The environment containing the parameters required to make AWS
-- requests.
data Env
-- | The current region.
envRegion :: Lens' Env Region
-- | The function used to output log messages.
envLogger :: Lens' Env Logger
-- | The function used to determine if an HttpException should be
-- retried.
envRetryCheck :: Lens' Env (Int -> HttpException -> IO Bool)
-- | The RetryPolicy used to determine backoffon and retry
-- delaygrowth.
envRetryPolicy :: Lens' Env (Maybe RetryPolicy)
-- | The Manager used to create and manage open HTTP connections.
envManager :: Lens' Env Manager
-- | The credentials used to sign requests for authentication with AWS.
envAuth :: Lens' Env Auth
-- | 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.
newEnv :: (Functor m, MonadIO m) => Region -> Credentials -> Manager -> ExceptT String m Env
-- | Create a new environment in the specified Region with silent
-- log output and a new Manager.
--
-- Any errors are thrown using error.
--
-- See: newEnv for safe Env instantiation.
getEnv :: Region -> Credentials -> IO Env
-- | Determines how authentication information is retrieved.
data Credentials
-- | Explicit access and secret keys. Note: you can achieve the same
-- result purely using fromKeys without having to use the impure
-- getAuth.
FromKeys :: AccessKey -> SecretKey -> Credentials
-- | A session containing the access key, secret key, and a security token.
-- Note: you can achieve the same result purely using
-- fromSession without having to use the impure getAuth.
FromSession :: AccessKey -> SecretKey -> SecurityToken -> Credentials
-- | An IAM Profile name to lookup from the local EC2 instance-data.
FromProfile :: Text -> Credentials
-- | Environment variables to lookup for the access and secret keys.
FromEnv :: Text -> Text -> Credentials
-- | 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.
Discover :: Credentials
-- | Explicit access and secret keys.
fromKeys :: AccessKey -> SecretKey -> Auth
-- | A session containing the access key, secret key, and a security token.
fromSession :: AccessKey -> SecretKey -> SecurityToken -> Auth
-- | Retrieve authentication information using the specified
-- Credentials style.
getAuth :: (Functor m, MonadIO m) => Manager -> Credentials -> ExceptT String m Auth
-- | Default access key environment variable.
accessKey :: Text
-- | Default secret key environment variable.
secretKey :: Text
-- | This is a primitive logger which can be used to log messages to a
-- Handle. A more sophisticated logging library such as tinylog or
-- FastLogger should be used in production code.
newLogger :: MonadIO m => LogLevel -> Handle -> m Logger
-- | A monad transformer built on top of functions from Network.AWS
-- which encapsulates various common parameters, errors, and usage
-- patterns.
module Control.Monad.Trans.AWS
-- | Send a data type which is an instance of AWSRequest, returning
-- it's associated Rs response type.
--
-- This will throw any HTTPException or AWSServiceError
-- returned by the service using the MonadError instance. In the
-- case of AWST this will cause the internal ExceptT to
-- short-circuit and return an Error in the Left case as
-- the result of the computation.
--
-- See: sendCatch
send :: (MonadCatch m, MonadResource m, MonadReader Env m, MonadError Error m, AWSRequest a) => a -> m (Rs a)
-- | A variant of send which discards any successful response.
--
-- See: send
send_ :: (MonadCatch m, MonadResource m, MonadReader Env m, MonadError Error m, AWSRequest a) => a -> m ()
-- | 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.
--
-- Note: Requests will be retried depending upon each service's
-- respective strategy. This can be overriden using once or
-- envRetry. Requests which contain streaming request bodies
-- (such as S3's PutObject) are never considered for retries.
sendCatch :: (MonadCatch m, MonadResource m, MonadReader Env m, AWSRequest a) => a -> m (Response a)
-- | Send a data type which is an instance of AWSPager and paginate
-- while there are more results as defined by the related service
-- operation.
--
-- Errors will be handle identically to send.
--
-- Note: The ResumableSource will close when there are no
-- more results or the ResourceT computation is unwrapped. See:
-- runResourceT for more information.
--
-- See: paginateCatch
paginate :: (MonadCatch m, MonadResource m, MonadReader Env m, MonadError Error m, AWSPager a) => a -> Source m (Rs a)
-- | 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.
paginateCatch :: (MonadCatch m, MonadResource m, MonadReader Env m, AWSPager a) => a -> Source m (Response a)
-- | Poll the API until a predfined condition is fulfilled using the
-- supplied Wait specification from the respective service.
--
-- Any errors which are unhandled by the Wait specification during
-- retries will be thrown in the same manner as send.
--
-- See: awaitCatch
await :: (MonadCatch m, MonadResource m, MonadReader Env m, MonadError Error m, AWSRequest a) => Wait a -> a -> m (Rs a)
-- | Poll the API until a predfined condition is fulfilled using the
-- supplied Wait specification from the respective service.
--
-- The response will be either the first error returned that is not
-- handled by the specification, or the successful response from the
-- await request.
--
-- Note: You can find any available Wait specifications
-- under the namespace Network.AWS.ServiceName.Waiters
-- for supported services.
awaitCatch :: (MonadCatch m, MonadResource m, MonadReader Env m, AWSRequest a) => Wait a -> a -> m (Response a)
-- | Presign an HTTP request that expires at the specified amount of time
-- in the future.
--
-- Note: Requires the service's signer to be an instance of
-- AWSPresigner. Not all signing process support this.
presign :: (MonadIO m, MonadReader Env m, AWSRequest a, AWSPresigner (Sg (Sv a))) => a -> UTCTime -> Integer -> m Request
-- | Presign a URL that expires at the specified amount of time in the
-- future.
--
-- See: presign
presignURL :: (MonadIO m, MonadReader Env m, AWSRequest a, AWSPresigner (Sg (Sv a))) => a -> UTCTime -> Integer -> m ByteString
-- | A convenient alias for AWST IO.
type AWS = AWST IO
-- | The transformer. This satisfies all of the constraints that the
-- functions in this module require, such as providing
-- MonadResource instances, and keeping track of the Env
-- environment.
--
-- The MonadError instance for this transformer internally uses
-- ExceptT to handle actions that result in an Error. For
-- more information see sendCatch and paginateCatch.
data AWST m a
-- | Provides an alias for shortening type signatures if preferred.
--
-- Note: requires the ConstraintKinds extension.
type MonadAWS m = (MonadBaseControl IO m, MonadCatch m, MonadResource m, MonadError Error m, MonadReader Env m)
-- | Unwrap an AWST transformer, calling all of the registered
-- ResourceT release actions.
runAWST :: MonadBaseControl IO m => Env -> AWST m a -> m (Either Error a)
data Region :: *
Ireland :: Region
Frankfurt :: Region
Tokyo :: Region
Singapore :: Region
Sydney :: Region
Beijing :: Region
NorthVirginia :: Region
NorthCalifornia :: Region
Oregon :: Region
GovCloud :: Region
GovCloudFIPS :: Region
SaoPaulo :: Region
-- | Scope a monadic action within the specific Region.
within :: MonadReader Env m => Region -> m a -> m a
-- | Scope a monadic action such that any retry logic for the
-- Service is ignored and any requests will at most be sent once.
once :: MonadReader Env m => m a -> m a
-- | The environment containing the parameters required to make AWS
-- requests.
data Env
-- | The current region.
envRegion :: Lens' Env Region
-- | The function used to output log messages.
envLogger :: Lens' Env Logger
-- | The function used to determine if an HttpException should be
-- retried.
envRetryCheck :: Lens' Env (Int -> HttpException -> IO Bool)
-- | The RetryPolicy used to determine backoffon and retry
-- delaygrowth.
envRetryPolicy :: Lens' Env (Maybe RetryPolicy)
-- | The Manager used to create and manage open HTTP connections.
envManager :: Lens' Env Manager
-- | The credentials used to sign requests for authentication with AWS.
envAuth :: Lens' Env Auth
-- | 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.
newEnv :: (Functor m, MonadIO m) => Region -> Credentials -> Manager -> ExceptT String m Env
-- | Create a new environment in the specified Region with silent
-- log output and a new Manager.
--
-- Any errors are thrown using error.
--
-- See: newEnv for safe Env instantiation.
getEnv :: Region -> Credentials -> IO Env
-- | Determines how authentication information is retrieved.
data Credentials
-- | Explicit access and secret keys. Note: you can achieve the same
-- result purely using fromKeys without having to use the impure
-- getAuth.
FromKeys :: AccessKey -> SecretKey -> Credentials
-- | A session containing the access key, secret key, and a security token.
-- Note: you can achieve the same result purely using
-- fromSession without having to use the impure getAuth.
FromSession :: AccessKey -> SecretKey -> SecurityToken -> Credentials
-- | An IAM Profile name to lookup from the local EC2 instance-data.
FromProfile :: Text -> Credentials
-- | Environment variables to lookup for the access and secret keys.
FromEnv :: Text -> Text -> Credentials
-- | 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.
Discover :: Credentials
-- | Explicit access and secret keys.
fromKeys :: AccessKey -> SecretKey -> Auth
-- | A session containing the access key, secret key, and a security token.
fromSession :: AccessKey -> SecretKey -> SecurityToken -> Auth
-- | Retrieve authentication information using the specified
-- Credentials style.
getAuth :: (Functor m, MonadIO m) => Manager -> Credentials -> ExceptT String m Auth
-- | Default access key environment variable.
accessKey :: Text
-- | Default secret key environment variable.
secretKey :: Text
-- | This is a primitive logger which can be used to log messages to a
-- Handle. A more sophisticated logging library such as tinylog or
-- FastLogger should be used in production code.
newLogger :: MonadIO m => LogLevel -> Handle -> m Logger
-- | Use the supplied logger from envLogger to log info messages.
--
-- Note: By default, the library does not output Info level
-- messages. Exclusive output is guaranteed via use of this function.
info :: (MonadIO m, MonadReader Env m, ToBuilder a) => a -> m ()
-- | Use the supplied logger from envLogger to log debug messages.
debug :: (MonadIO m, MonadReader Env m, ToBuilder a) => a -> m ()
-- | Use the supplied logger from envLogger to log trace messages.
trace :: (MonadIO m, MonadReader Env m, ToBuilder a) => a -> m ()
-- | The top-level error type.
type Error = ServiceError String
-- | Hoist an Either throwing the Left case, and returning
-- the Right.
hoistEither :: (MonadError Error m, AWSError e) => Either e a -> m a
-- | Throw any AWSError using throwError.
throwAWSError :: (MonadError Error m, AWSError e) => e -> m a
-- | Verify that an AWSError matches the given Prism,
-- otherwise throw the error using throwAWSError.
verify :: (AWSError e, MonadError Error m) => Prism' e a -> e -> m ()
-- | Verify that an AWSError matches the given Prism, with an
-- additional guard on the result of the Prism.
--
-- See: verify
verifyWith :: (AWSError e, MonadError Error m) => Prism' e a -> (a -> Bool) -> e -> m ()
class ToBuilder a
build :: ToBuilder a => a -> Builder
instance Functor m => Functor (AWST m)
instance (Monad m, Functor m) => Applicative (AWST m)
instance (Monad m, Functor m) => Alternative (AWST m)
instance Monad m => Monad (AWST m)
instance MonadIO m => MonadIO (AWST m)
instance Monad m => MonadPlus (AWST m)
instance MonadThrow m => MonadThrow (AWST m)
instance MonadCatch m => MonadCatch (AWST m)
instance Monad m => MonadError Error (AWST m)
instance (Applicative m, MonadIO m, MonadBase IO m, MonadThrow m) => MonadResource (AWST m)
instance MMonad AWST
instance MFunctor AWST
instance MonadBaseControl b m => MonadBaseControl b (AWST m)
instance MonadTransControl AWST
instance MonadBase b m => MonadBase b (AWST m)
instance MonadTrans AWST
instance Monad m => MonadReader Env (AWST m)