amazonka-2.0: Comprehensive Amazon Web Services SDK.
Copyright(c) 2013-2023 Brendan Hay
LicenseMozilla Public License, v. 2.0.
MaintainerBrendan Hay <brendan.g.hay+amazonka@gmail.com>
Stabilityprovisional
Portabilitynon-portable (GHC extensions)
Safe HaskellSafe-Inferred
LanguageHaskell2010

Amazonka.EC2.Metadata

Description

This module contains functions for retrieving various EC2 metadata from an instance's local metadata endpoint. It assumes that you're running the code on an EC2 instance or have a compatible instance-data endpoint available.

It is intended to be usable when you need to make metadata calls prior to initialisation of the Env.

Synopsis

EC2 Instance Check

isEC2 :: MonadIO m => Manager -> m Bool Source #

Test whether the underlying host is running on EC2 by making an HTTP request to http://instance-data/latest.

Retrieving Instance Data

dynamic :: MonadIO m => Manager -> Dynamic -> m ByteString Source #

Retrieve the specified Dynamic data.

Throws HttpException if HTTP communication fails.

metadata :: MonadIO m => Manager -> Metadata -> m ByteString Source #

Retrieve the specified Metadata.

Throws HttpException if HTTP communication fails.

userdata :: MonadIO m => Manager -> m (Maybe ByteString) Source #

Retrieve the user data. Returns Nothing if no user data is assigned to the instance.

Throws HttpException if HTTP communication fails.

identity :: MonadIO m => Manager -> m (Either String IdentityDocument) Source #

Retrieve the instance's identity document, detailing various EC2 metadata.

You can alternatively retrieve the raw unparsed identity document by using dynamic and the Document path.

See: AWS Instance Identity Documents.

Path Constructors

data Dynamic Source #

Constructors

FWS

Value showing whether the customer has enabled detailed one-minute monitoring in CloudWatch.

Valid values: enabled | disabled.

Document

JSON containing instance attributes, such as instance-id, private IP address, etc. See: identity, InstanceDocument.

PKCS7

Used to verify the document's authenticity and content against the signature.

Signature

Data that can be used by other parties to verify its origin and authenticity.

Instances

Instances details
ToText Dynamic Source # 
Instance details

Defined in Amazonka.EC2.Metadata

Methods

toText :: Dynamic -> Text #

Generic Dynamic Source # 
Instance details

Defined in Amazonka.EC2.Metadata

Associated Types

type Rep Dynamic :: Type -> Type #

Methods

from :: Dynamic -> Rep Dynamic x #

to :: Rep Dynamic x -> Dynamic #

Show Dynamic Source # 
Instance details

Defined in Amazonka.EC2.Metadata

Eq Dynamic Source # 
Instance details

Defined in Amazonka.EC2.Metadata

Methods

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

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

Ord Dynamic Source # 
Instance details

Defined in Amazonka.EC2.Metadata

type Rep Dynamic Source # 
Instance details

Defined in Amazonka.EC2.Metadata

type Rep Dynamic = D1 ('MetaData "Dynamic" "Amazonka.EC2.Metadata" "amazonka-2.0-48plDWnPMAk3PGO79vdSa0" 'False) ((C1 ('MetaCons "FWS" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Document" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "PKCS7" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Signature" 'PrefixI 'False) (U1 :: Type -> Type)))

data Metadata Source #

Instance metadata categories. The list of supported categories are listed in the EC2 Documentation.

Constructors

AMIId

The AMI ID used to launch the instance.

AMILaunchIndex

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.

AMIManifestPath

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.

AncestorAMIIds

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.

Autoscaling !Autoscaling

See: Metadata

BlockDevice !Mapping

See: Mapping

ElasticGpus !ElasticGpus

See: Metadata

ElasticInference !ElasticInference

See Metadata

Events !Events

See Metadata

Hostname

If the EC2 instance is using IP-based naming (IPBN), this is the private IPv4 DNS hostname of the instance. If the EC2 instance is using Resource-based naming (RBN), this is the RBN. In cases where multiple network interfaces are present, this refers to the eth0 device (the device for which the device number is 0). For more information about IPBN and RBN, see Amazon EC2 instance hostname types.

IAM !IAM

See: Metadata

IdentityCredentialsEC2 !IdentityCredentialsEC2

See: Metadata

InstanceAction

Notifies the instance that it should reboot in preparation for bundling. Valid values: none | shutdown | bundle-pending.

InstanceId

The ID of this instance.

InstanceLifeCycle

The purchasing option of this instance. For more information, see Instance purchasing options.

InstanceType

The type of instance. For more information, see Instance types.

IPV6

The IPv6 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) network interface and the first IPv6 address assigned. If no IPv6 address exists on network interface[0], this item is not set and results in an HTTP 404 response.

KernelId

The ID of the kernel launched with this instance, if applicable.

LocalHostname

In cases where multiple network interfaces are present, this refers to the eth0 device (the device for which the device number is 0). If the EC2 instance is using IP-based naming (IPBN), this is the private IPv4 DNS hostname of the instance. If the EC2 instance is using Resource-based naming (RBN), this is the RBN. For more information about IPBN, RBN, and EC2 instance naming, see Amazon EC2 instance hostname types.

LocalIPV4

The private IPv4 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). If this is an IPv6-only instance, this item is not set and results in an HTTP 404 response.

MAC

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).

Network !Text !Interface

See: Interface

Placement !Placement

See: Metadata

ProductCodes

AWS Marketplace product codes associated with the instance, if any.

PublicHostname

The instance's public DNS (IPv4). This category is only returned if the enableDnsHostnames attribute is set to true. For more information, see Using DNS with Your VPC in the Amazon VPC User Guide. If the instance only has a public-IPv6 address and no public-IPv4 address, this item is not set and results in an HTTP 404 response.

PublicIPV4

The public IP address. If an Elastic IP address is associated with the instance, the value returned is the Elastic IP address.

OpenSSHKey

Public key. Only available if supplied at instance launch time.

RAMDiskId

The ID of the RAM disk specified at launch time, if applicable.

ReservationId

ID of the reservation.

SecurityGroups

The names of the security groups applied to the instance.

After launch, you can change the security groups of the instances. Such changes are reflected here and in network/interfaces/macs/${mac}/security-groups.

Services !Services

See: Metadata

Spot !Spot

See: Metadata

Tags !Tags

See: Metadata

Instances

Instances details
ToText Metadata Source # 
Instance details

Defined in Amazonka.EC2.Metadata

Methods

toText :: Metadata -> Text #

Generic Metadata Source # 
Instance details

Defined in Amazonka.EC2.Metadata

Associated Types

type Rep Metadata :: Type -> Type #

Methods

from :: Metadata -> Rep Metadata x #

to :: Rep Metadata x -> Metadata #

Show Metadata Source # 
Instance details

Defined in Amazonka.EC2.Metadata

Eq Metadata Source # 
Instance details

Defined in Amazonka.EC2.Metadata

Ord Metadata Source # 
Instance details

Defined in Amazonka.EC2.Metadata

type Rep Metadata Source # 
Instance details

Defined in Amazonka.EC2.Metadata

type Rep Metadata = D1 ('MetaData "Metadata" "Amazonka.EC2.Metadata" "amazonka-2.0-48plDWnPMAk3PGO79vdSa0" 'False) (((((C1 ('MetaCons "AMIId" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "AMILaunchIndex" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "AMIManifestPath" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "AncestorAMIIds" 'PrefixI 'False) (U1 :: Type -> Type))) :+: ((C1 ('MetaCons "Autoscaling" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Autoscaling)) :+: C1 ('MetaCons "BlockDevice" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Mapping))) :+: (C1 ('MetaCons "ElasticGpus" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 ElasticGpus)) :+: C1 ('MetaCons "ElasticInference" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 ElasticInference))))) :+: (((C1 ('MetaCons "Events" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Events)) :+: C1 ('MetaCons "Hostname" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "IAM" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 IAM)) :+: C1 ('MetaCons "IdentityCredentialsEC2" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 IdentityCredentialsEC2)))) :+: ((C1 ('MetaCons "InstanceAction" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "InstanceId" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "InstanceLifeCycle" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "InstanceType" 'PrefixI 'False) (U1 :: Type -> Type))))) :+: ((((C1 ('MetaCons "IPV6" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "KernelId" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "LocalHostname" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "LocalIPV4" 'PrefixI 'False) (U1 :: Type -> Type))) :+: ((C1 ('MetaCons "MAC" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Network" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Text) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Interface))) :+: (C1 ('MetaCons "Placement" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Placement)) :+: C1 ('MetaCons "ProductCodes" 'PrefixI 'False) (U1 :: Type -> Type)))) :+: (((C1 ('MetaCons "PublicHostname" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "PublicIPV4" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "OpenSSHKey" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "RAMDiskId" 'PrefixI 'False) (U1 :: Type -> Type))) :+: ((C1 ('MetaCons "ReservationId" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "SecurityGroups" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "Services" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Services)) :+: (C1 ('MetaCons "Spot" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Spot)) :+: C1 ('MetaCons "Tags" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Tags))))))))

data Autoscaling Source #

Metadata keys for autoscaling/*.

Constructors

TargetLifecycleState

Value showing the target Auto Scaling lifecycle state that an Auto Scaling instance is transitioning to. Present when the instance transitions to one of the target lifecycle states after March 10, 2022. Possible values: Detached | InService | Standby | Terminated | Warmed:Hibernated | Warmed:Running | Warmed:Stopped | Warmed:Terminated. See Retrieve the target lifecycle state through instance metadata in the Amazon EC2 Auto Scaling User Guide.

Instances

Instances details
ToText Autoscaling Source # 
Instance details

Defined in Amazonka.EC2.Metadata

Methods

toText :: Autoscaling -> Text #

Generic Autoscaling Source # 
Instance details

Defined in Amazonka.EC2.Metadata

Associated Types

type Rep Autoscaling :: Type -> Type #

Show Autoscaling Source # 
Instance details

Defined in Amazonka.EC2.Metadata

Eq Autoscaling Source # 
Instance details

Defined in Amazonka.EC2.Metadata

Ord Autoscaling Source # 
Instance details

Defined in Amazonka.EC2.Metadata

type Rep Autoscaling Source # 
Instance details

Defined in Amazonka.EC2.Metadata

type Rep Autoscaling = D1 ('MetaData "Autoscaling" "Amazonka.EC2.Metadata" "amazonka-2.0-48plDWnPMAk3PGO79vdSa0" 'False) (C1 ('MetaCons "TargetLifecycleState" 'PrefixI 'False) (U1 :: Type -> Type))

data Mapping Source #

Metadata keys for block-device-mapping/*.

Constructors

AMI

The virtual device that contains the root/boot file system.

EBS !Int

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).

Ephemeral !Int

The virtual devices associated with ephemeral devices, if present. The N indicates the index of the ephemeral volume.

Root

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.

Swap

The virtual devices associated with swap. Not always present.

Instances

Instances details
ToText Mapping Source # 
Instance details

Defined in Amazonka.EC2.Metadata

Methods

toText :: Mapping -> Text #

Generic Mapping Source # 
Instance details

Defined in Amazonka.EC2.Metadata

Associated Types

type Rep Mapping :: Type -> Type #

Methods

from :: Mapping -> Rep Mapping x #

to :: Rep Mapping x -> Mapping #

Show Mapping Source # 
Instance details

Defined in Amazonka.EC2.Metadata

Eq Mapping Source # 
Instance details

Defined in Amazonka.EC2.Metadata

Methods

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

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

Ord Mapping Source # 
Instance details

Defined in Amazonka.EC2.Metadata

type Rep Mapping Source # 
Instance details

Defined in Amazonka.EC2.Metadata

type Rep Mapping = D1 ('MetaData "Mapping" "Amazonka.EC2.Metadata" "amazonka-2.0-48plDWnPMAk3PGO79vdSa0" 'False) ((C1 ('MetaCons "AMI" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "EBS" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Int))) :+: (C1 ('MetaCons "Ephemeral" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Int)) :+: (C1 ('MetaCons "Root" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Swap" 'PrefixI 'False) (U1 :: Type -> Type))))

newtype ElasticGpus Source #

Metadata keys for elastic-gpus/*.

Constructors

EGAssociations Text

If there is an Elastic GPU attached to the instance, contains a JSON string with information about the Elastic GPU, including its ID and connection information.

Instances

Instances details
ToText ElasticGpus Source # 
Instance details

Defined in Amazonka.EC2.Metadata

Methods

toText :: ElasticGpus -> Text #

Generic ElasticGpus Source # 
Instance details

Defined in Amazonka.EC2.Metadata

Associated Types

type Rep ElasticGpus :: Type -> Type #

Show ElasticGpus Source # 
Instance details

Defined in Amazonka.EC2.Metadata

Eq ElasticGpus Source # 
Instance details

Defined in Amazonka.EC2.Metadata

Ord ElasticGpus Source # 
Instance details

Defined in Amazonka.EC2.Metadata

type Rep ElasticGpus Source # 
Instance details

Defined in Amazonka.EC2.Metadata

type Rep ElasticGpus = D1 ('MetaData "ElasticGpus" "Amazonka.EC2.Metadata" "amazonka-2.0-48plDWnPMAk3PGO79vdSa0" 'True) (C1 ('MetaCons "EGAssociations" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text)))

newtype ElasticInference Source #

Metadata keys for elastic-inference/*.

Constructors

EIAssociations Text

If there is an Elastic Inference accelerator attached to the instance, contains a JSON string with information about the Elastic Inference accelerator, including its ID and type.

Instances

Instances details
ToText ElasticInference Source # 
Instance details

Defined in Amazonka.EC2.Metadata

Generic ElasticInference Source # 
Instance details

Defined in Amazonka.EC2.Metadata

Associated Types

type Rep ElasticInference :: Type -> Type #

Show ElasticInference Source # 
Instance details

Defined in Amazonka.EC2.Metadata

Eq ElasticInference Source # 
Instance details

Defined in Amazonka.EC2.Metadata

Ord ElasticInference Source # 
Instance details

Defined in Amazonka.EC2.Metadata

type Rep ElasticInference Source # 
Instance details

Defined in Amazonka.EC2.Metadata

type Rep ElasticInference = D1 ('MetaData "ElasticInference" "Amazonka.EC2.Metadata" "amazonka-2.0-48plDWnPMAk3PGO79vdSa0" 'True) (C1 ('MetaCons "EIAssociations" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text)))

data Events Source #

Metadata keys for events/*.

Instances

Instances details
ToText Events Source # 
Instance details

Defined in Amazonka.EC2.Metadata

Methods

toText :: Events -> Text #

Generic Events Source # 
Instance details

Defined in Amazonka.EC2.Metadata

Associated Types

type Rep Events :: Type -> Type #

Methods

from :: Events -> Rep Events x #

to :: Rep Events x -> Events #

Show Events Source # 
Instance details

Defined in Amazonka.EC2.Metadata

Eq Events Source # 
Instance details

Defined in Amazonka.EC2.Metadata

Methods

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

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

Ord Events Source # 
Instance details

Defined in Amazonka.EC2.Metadata

type Rep Events Source # 
Instance details

Defined in Amazonka.EC2.Metadata

type Rep Events = D1 ('MetaData "Events" "Amazonka.EC2.Metadata" "amazonka-2.0-48plDWnPMAk3PGO79vdSa0" 'False) (C1 ('MetaCons "Maintenance" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Maintenance)) :+: C1 ('MetaCons "Recommendations" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Recommendations)))

data Maintenance Source #

Metadata keys for eventsmaintenance*.

Constructors

History

If there are completed or canceled maintenance events for the instance, contains a JSON string with information about the events. For more information, see To view event history about completed or canceled events.

Scheduled

If there are active maintenance events for the instance, contains a JSON string with information about the events. For more information, see View scheduled events.

Instances

Instances details
ToText Maintenance Source # 
Instance details

Defined in Amazonka.EC2.Metadata

Methods

toText :: Maintenance -> Text #

Generic Maintenance Source # 
Instance details

Defined in Amazonka.EC2.Metadata

Associated Types

type Rep Maintenance :: Type -> Type #

Show Maintenance Source # 
Instance details

Defined in Amazonka.EC2.Metadata

Eq Maintenance Source # 
Instance details

Defined in Amazonka.EC2.Metadata

Ord Maintenance Source # 
Instance details

Defined in Amazonka.EC2.Metadata

type Rep Maintenance Source # 
Instance details

Defined in Amazonka.EC2.Metadata

type Rep Maintenance = D1 ('MetaData "Maintenance" "Amazonka.EC2.Metadata" "amazonka-2.0-48plDWnPMAk3PGO79vdSa0" 'False) (C1 ('MetaCons "History" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Scheduled" 'PrefixI 'False) (U1 :: Type -> Type))

data Recommendations Source #

Metadata keys for events/recommendations/*.

Constructors

Rebalance

The approximate time, in UTC, when the EC2 instance rebalance recommendation notification is emitted for the instance. The following is an example of the metadata for this category: {"noticeTime": "2020-11-05T08:22:00Z"}. This category is available only after the notification is emitted. For more information, see EC2 instance rebalance recommendations.

Instances

Instances details
ToText Recommendations Source # 
Instance details

Defined in Amazonka.EC2.Metadata

Generic Recommendations Source # 
Instance details

Defined in Amazonka.EC2.Metadata

Associated Types

type Rep Recommendations :: Type -> Type #

Show Recommendations Source # 
Instance details

Defined in Amazonka.EC2.Metadata

Eq Recommendations Source # 
Instance details

Defined in Amazonka.EC2.Metadata

Ord Recommendations Source # 
Instance details

Defined in Amazonka.EC2.Metadata

type Rep Recommendations Source # 
Instance details

Defined in Amazonka.EC2.Metadata

type Rep Recommendations = D1 ('MetaData "Recommendations" "Amazonka.EC2.Metadata" "amazonka-2.0-48plDWnPMAk3PGO79vdSa0" 'False) (C1 ('MetaCons "Rebalance" 'PrefixI 'False) (U1 :: Type -> Type))

data IAM Source #

Metadata keys for iam/*.

Constructors

Info

If there is an IAM role associated with the instance, contains information about the last time the instance profile was updated, including the instance's LastUpdated date, InstanceProfileArn, and InstanceProfileId. Otherwise, not present.

SecurityCredentials (Maybe Text)

If there is an IAM role associated with the instance, role-name is the name of the role, and role-name contains the temporary security credentials associated with the role (for more information, see Retrieve security credentials from instance metadata). Otherwise, not present.

See: Auth for JSON deserialisation.

Instances

Instances details
ToText IAM Source # 
Instance details

Defined in Amazonka.EC2.Metadata

Methods

toText :: IAM -> Text #

Generic IAM Source # 
Instance details

Defined in Amazonka.EC2.Metadata

Associated Types

type Rep IAM :: Type -> Type #

Methods

from :: IAM -> Rep IAM x #

to :: Rep IAM x -> IAM #

Show IAM Source # 
Instance details

Defined in Amazonka.EC2.Metadata

Methods

showsPrec :: Int -> IAM -> ShowS #

show :: IAM -> String #

showList :: [IAM] -> ShowS #

Eq IAM Source # 
Instance details

Defined in Amazonka.EC2.Metadata

Methods

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

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

Ord IAM Source # 
Instance details

Defined in Amazonka.EC2.Metadata

Methods

compare :: IAM -> IAM -> Ordering #

(<) :: IAM -> IAM -> Bool #

(<=) :: IAM -> IAM -> Bool #

(>) :: IAM -> IAM -> Bool #

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

max :: IAM -> IAM -> IAM #

min :: IAM -> IAM -> IAM #

type Rep IAM Source # 
Instance details

Defined in Amazonka.EC2.Metadata

type Rep IAM = D1 ('MetaData "IAM" "Amazonka.EC2.Metadata" "amazonka-2.0-48plDWnPMAk3PGO79vdSa0" 'False) (C1 ('MetaCons "Info" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "SecurityCredentials" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Text))))

data IdentityCredentialsEC2 Source #

Metadata keys for identity-credentials/ec2/*.

Constructors

ICEInfo

Information about the credentials in identity-credentialsec2security-credentials/ec2-instance.

ICESecurityCredentials

Credentials for the instance identity role that allow on-instance software to identify itself to AWS to support features such as EC2 Instance Connect and AWS Systems Manager Default Host Management Configuration. These credentials have no policies attached, so they have no additional AWS API permissions beyond identifying the instance to the AWS feature. For more information, see Instance identity roles.

Instances

Instances details
ToText IdentityCredentialsEC2 Source # 
Instance details

Defined in Amazonka.EC2.Metadata

Generic IdentityCredentialsEC2 Source # 
Instance details

Defined in Amazonka.EC2.Metadata

Associated Types

type Rep IdentityCredentialsEC2 :: Type -> Type #

Show IdentityCredentialsEC2 Source # 
Instance details

Defined in Amazonka.EC2.Metadata

Eq IdentityCredentialsEC2 Source # 
Instance details

Defined in Amazonka.EC2.Metadata

Ord IdentityCredentialsEC2 Source # 
Instance details

Defined in Amazonka.EC2.Metadata

type Rep IdentityCredentialsEC2 Source # 
Instance details

Defined in Amazonka.EC2.Metadata

type Rep IdentityCredentialsEC2 = D1 ('MetaData "IdentityCredentialsEC2" "Amazonka.EC2.Metadata" "amazonka-2.0-48plDWnPMAk3PGO79vdSa0" 'False) (C1 ('MetaCons "ICEInfo" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "ICESecurityCredentials" 'PrefixI 'False) (U1 :: Type -> Type))

data Interface Source #

Metadata keys for network/interfaces/macs/${mac}/*.

Constructors

IDeviceNumber

The unique device number associated with that interface. The device number corresponds to the device name; for example, a device-number of 2 is for the eth2 device. This category corresponds to the DeviceIndex and device-index fields that are used by the Amazon EC2 API and the EC2 commands for the AWS CLI.

IInterfaceId

The ID of the network interface.

IIPV4Associations !Text

The private IPv4 addresses that are associated with each public-ip address and assigned to that interface.

IIPV6s

The IPv6 addresses associated with the interface. Returned only for instances launched into a VPC.

ILocalHostname

The private IPv4 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). If this is a IPv6-only instance, this is the resource-based name. For more information about IPBN and RBN, see Amazon EC2 instance hostname types.

ILocalIPV4s

The private IPv4 addresses associated with the interface. If this is an IPv6-only network interface, this item is not set and results in an HTTP 404 response.

IMAC

The instance's MAC address.

INetworkCardIndex

The index of the network card. Some instance types support multiple network cards.

IOwnerId

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.

IPublicHostname

The interface's public DNS (IPv4). This category is only returned if the enableDnsHostnames attribute is set to true. For more information, see Using DNS with Your VPC in the Amazon VPC User Guide. If the instance only has a public-IPv6 address and no public-IPv4 address, this item is not set and results in an HTTP 404 response.

IPublicIPV4s

The Elastic IP addresses associated with the interface. There may be multiple IP addresses on an instance.

ISecurityGroups

Security groups to which the network interface belongs.

ISecurityGroupIds

The IDs of the security groups to which the network interface belongs.

ISubnetId

The ID of the subnet in which the interface resides.

ISubnetIPV4_CIDRBlock

The IPv4 CIDR block of the subnet in which the interface resides.

ISubnetIPV6_CIDRBlock

The IPv6 CIDR block of the subnet in which the interface resides.

IVPCId

The ID of the VPC in which the interface resides.

IVPCIPV4_CIDRBlock

The primary IPv4 CIDR block of the VPC.

IVPCIPV4_CIDRBlocks

The IPv4 CIDR blocks for the VPC.

IVPCIPV6_CIDRBlocks

The IPv6 CIDR block of the VPC in which the interface resides.

Instances

Instances details
ToText Interface Source # 
Instance details

Defined in Amazonka.EC2.Metadata

Methods

toText :: Interface -> Text #

Generic Interface Source # 
Instance details

Defined in Amazonka.EC2.Metadata

Associated Types

type Rep Interface :: Type -> Type #

Show Interface Source # 
Instance details

Defined in Amazonka.EC2.Metadata

Eq Interface Source # 
Instance details

Defined in Amazonka.EC2.Metadata

Ord Interface Source # 
Instance details

Defined in Amazonka.EC2.Metadata

type Rep Interface Source # 
Instance details

Defined in Amazonka.EC2.Metadata

type Rep Interface = D1 ('MetaData "Interface" "Amazonka.EC2.Metadata" "amazonka-2.0-48plDWnPMAk3PGO79vdSa0" 'False) ((((C1 ('MetaCons "IDeviceNumber" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "IInterfaceId" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "IIPV4Associations" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Text)) :+: (C1 ('MetaCons "IIPV6s" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "ILocalHostname" 'PrefixI 'False) (U1 :: Type -> Type)))) :+: ((C1 ('MetaCons "ILocalIPV4s" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "IMAC" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "INetworkCardIndex" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "IOwnerId" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "IPublicHostname" 'PrefixI 'False) (U1 :: Type -> Type))))) :+: (((C1 ('MetaCons "IPublicIPV4s" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "ISecurityGroups" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "ISecurityGroupIds" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "ISubnetId" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "ISubnetIPV4_CIDRBlock" 'PrefixI 'False) (U1 :: Type -> Type)))) :+: ((C1 ('MetaCons "ISubnetIPV6_CIDRBlock" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "IVPCId" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "IVPCIPV4_CIDRBlock" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "IVPCIPV4_CIDRBlocks" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "IVPCIPV6_CIDRBlocks" 'PrefixI 'False) (U1 :: Type -> Type))))))

data Placement Source #

Metadata keys for placement/*.

Constructors

AvailabilityZone

The Availability Zone in which the instance launched.

AvailabilityZoneId

The static Availability Zone ID in which the instance is launched. The Availability Zone ID is consistent across accounts. However, it might be different from the Availability Zone, which can vary by account.

GroupName

The name of the placement group in which the instance is launched.

HostId

The ID of the host on which the instance is launched. Applicable only to Dedicated Hosts.

PartitionNumber

The number of the partition in which the instance is launched.

Region

The AWS Region in which the instance is launched.

Instances

Instances details
ToText Placement Source # 
Instance details

Defined in Amazonka.EC2.Metadata

Methods

toText :: Placement -> Text #

Generic Placement Source # 
Instance details

Defined in Amazonka.EC2.Metadata

Associated Types

type Rep Placement :: Type -> Type #

Show Placement Source # 
Instance details

Defined in Amazonka.EC2.Metadata

Eq Placement Source # 
Instance details

Defined in Amazonka.EC2.Metadata

Ord Placement Source # 
Instance details

Defined in Amazonka.EC2.Metadata

type Rep Placement Source # 
Instance details

Defined in Amazonka.EC2.Metadata

type Rep Placement = D1 ('MetaData "Placement" "Amazonka.EC2.Metadata" "amazonka-2.0-48plDWnPMAk3PGO79vdSa0" 'False) ((C1 ('MetaCons "AvailabilityZone" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "AvailabilityZoneId" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "GroupName" 'PrefixI 'False) (U1 :: Type -> Type))) :+: (C1 ('MetaCons "HostId" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "PartitionNumber" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Region" 'PrefixI 'False) (U1 :: Type -> Type))))

data Services Source #

Metadata keys for services/*.

Constructors

Domain

The domain for AWS resources for the Region.

Partition

The partition that the resource is in. For standard AWS Regions, the partition is aws. If you have resources in other partitions, the partition is aws-${partitionname}. For example, the partition for resources in the China (Beijing) Region is aws-cn.

Instances

Instances details
ToText Services Source # 
Instance details

Defined in Amazonka.EC2.Metadata

Methods

toText :: Services -> Text #

Generic Services Source # 
Instance details

Defined in Amazonka.EC2.Metadata

Associated Types

type Rep Services :: Type -> Type #

Methods

from :: Services -> Rep Services x #

to :: Rep Services x -> Services #

Show Services Source # 
Instance details

Defined in Amazonka.EC2.Metadata

Eq Services Source # 
Instance details

Defined in Amazonka.EC2.Metadata

Ord Services Source # 
Instance details

Defined in Amazonka.EC2.Metadata

type Rep Services Source # 
Instance details

Defined in Amazonka.EC2.Metadata

type Rep Services = D1 ('MetaData "Services" "Amazonka.EC2.Metadata" "amazonka-2.0-48plDWnPMAk3PGO79vdSa0" 'False) (C1 ('MetaCons "Domain" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Partition" 'PrefixI 'False) (U1 :: Type -> Type))

data Spot Source #

Metadata keys for spot/*.

Constructors

SInstanceAction

The action (hibernate, stop, or terminate) and the approximate time, in UTC, when the action will occur. This item is present only if the Spot Instance has been marked for hibernate, stop, or terminate. For more information, see instance-action.

STerminationTime

The approximate time, in UTC, that the operating system for your Spot Instance will receive the shutdown signal. This item is present and contains a time value (for example, 2015-01-05T18:02:00Z) only if the Spot Instance has been marked for termination by Amazon EC2. The termination-time item is not set to a time if you terminated the Spot Instance yourself. For more information, see termination-time.

Instances

Instances details
ToText Spot Source # 
Instance details

Defined in Amazonka.EC2.Metadata

Methods

toText :: Spot -> Text #

Generic Spot Source # 
Instance details

Defined in Amazonka.EC2.Metadata

Associated Types

type Rep Spot :: Type -> Type #

Methods

from :: Spot -> Rep Spot x #

to :: Rep Spot x -> Spot #

Show Spot Source # 
Instance details

Defined in Amazonka.EC2.Metadata

Methods

showsPrec :: Int -> Spot -> ShowS #

show :: Spot -> String #

showList :: [Spot] -> ShowS #

Eq Spot Source # 
Instance details

Defined in Amazonka.EC2.Metadata

Methods

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

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

Ord Spot Source # 
Instance details

Defined in Amazonka.EC2.Metadata

Methods

compare :: Spot -> Spot -> Ordering #

(<) :: Spot -> Spot -> Bool #

(<=) :: Spot -> Spot -> Bool #

(>) :: Spot -> Spot -> Bool #

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

max :: Spot -> Spot -> Spot #

min :: Spot -> Spot -> Spot #

type Rep Spot Source # 
Instance details

Defined in Amazonka.EC2.Metadata

type Rep Spot = D1 ('MetaData "Spot" "Amazonka.EC2.Metadata" "amazonka-2.0-48plDWnPMAk3PGO79vdSa0" 'False) (C1 ('MetaCons "SInstanceAction" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "STerminationTime" 'PrefixI 'False) (U1 :: Type -> Type))

data Tags Source #

Metadata keys for tags/*.

Constructors

Instance

The instance tags associated with the instance. Only available if you explicitly allow access to tags in instance metadata. For more information, see Allow access to tags in instance metadata.

Instances

Instances details
ToText Tags Source # 
Instance details

Defined in Amazonka.EC2.Metadata

Methods

toText :: Tags -> Text #

Generic Tags Source # 
Instance details

Defined in Amazonka.EC2.Metadata

Associated Types

type Rep Tags :: Type -> Type #

Methods

from :: Tags -> Rep Tags x #

to :: Rep Tags x -> Tags #

Show Tags Source # 
Instance details

Defined in Amazonka.EC2.Metadata

Methods

showsPrec :: Int -> Tags -> ShowS #

show :: Tags -> String #

showList :: [Tags] -> ShowS #

Eq Tags Source # 
Instance details

Defined in Amazonka.EC2.Metadata

Methods

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

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

Ord Tags Source # 
Instance details

Defined in Amazonka.EC2.Metadata

Methods

compare :: Tags -> Tags -> Ordering #

(<) :: Tags -> Tags -> Bool #

(<=) :: Tags -> Tags -> Bool #

(>) :: Tags -> Tags -> Bool #

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

max :: Tags -> Tags -> Tags #

min :: Tags -> Tags -> Tags #

type Rep Tags Source # 
Instance details

Defined in Amazonka.EC2.Metadata

type Rep Tags = D1 ('MetaData "Tags" "Amazonka.EC2.Metadata" "amazonka-2.0-48plDWnPMAk3PGO79vdSa0" 'False) (C1 ('MetaCons "Instance" 'PrefixI 'False) (U1 :: Type -> Type))

Identity Document

data IdentityDocument Source #

Represents an instance's identity document.

Note: Fields such as _instanceType are represented as unparsed Text and will need to be manually parsed using fromText when the relevant types from a library such as Amazonka.EC2 are brought into scope.

Instances

Instances details
FromJSON IdentityDocument Source # 
Instance details

Defined in Amazonka.EC2.Metadata

ToJSON IdentityDocument Source # 
Instance details

Defined in Amazonka.EC2.Metadata

Generic IdentityDocument Source # 
Instance details

Defined in Amazonka.EC2.Metadata

Associated Types

type Rep IdentityDocument :: Type -> Type #

Show IdentityDocument Source # 
Instance details

Defined in Amazonka.EC2.Metadata

Eq IdentityDocument Source # 
Instance details

Defined in Amazonka.EC2.Metadata

type Rep IdentityDocument Source # 
Instance details

Defined in Amazonka.EC2.Metadata

type Rep IdentityDocument = D1 ('MetaData "IdentityDocument" "Amazonka.EC2.Metadata" "amazonka-2.0-48plDWnPMAk3PGO79vdSa0" 'False) (C1 ('MetaCons "IdentityDocument" 'PrefixI 'True) (((S1 ('MetaSel ('Just "devpayProductCodes") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe [Text])) :*: (S1 ('MetaSel ('Just "billingProducts") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe [Text])) :*: S1 ('MetaSel ('Just "version") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Text)))) :*: ((S1 ('MetaSel ('Just "privateIp") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Text)) :*: S1 ('MetaSel ('Just "availabilityZone") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Text)) :*: (S1 ('MetaSel ('Just "region") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Region) :*: S1 ('MetaSel ('Just "instanceId") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Text)))) :*: ((S1 ('MetaSel ('Just "instanceType") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Text) :*: (S1 ('MetaSel ('Just "accountId") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Text) :*: S1 ('MetaSel ('Just "imageId") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Text)))) :*: ((S1 ('MetaSel ('Just "kernelId") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Text)) :*: S1 ('MetaSel ('Just "ramdiskId") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Text))) :*: (S1 ('MetaSel ('Just "architecture") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Text)) :*: S1 ('MetaSel ('Just "pendingTime") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe ISO8601)))))))

Lenses