Amazon Elastic Compute Cloud

2016/06/28 - Amazon Elastic Compute Cloud - 7 updated api methods

DescribeImages (updated) Link ¶
Changes (response)
{'Images': {'EnaSupport': 'boolean'}}

Describes one or more of the images (AMIs, AKIs, and ARIs) available to you. Images available to you include public images, private images that you own, and private images owned by other AWS accounts but for which you have explicit launch permissions.

Note

Deregistered images are included in the returned results for an unspecified interval after deregistration.

Request Syntax

client.describe_images(
    DryRun=True|False,
    ImageIds=[
        'string',
    ],
    Owners=[
        'string',
    ],
    ExecutableUsers=[
        'string',
    ],
    Filters=[
        {
            'Name': 'string',
            'Values': [
                'string',
            ]
        },
    ]
)
type DryRun

boolean

param DryRun

Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation . Otherwise, it is UnauthorizedOperation .

type ImageIds

list

param ImageIds

One or more image IDs.

Default: Describes all images available to you.

  • (string) --

type Owners

list

param Owners

Filters the images by the owner. Specify an AWS account ID, amazon (owner is Amazon), aws-marketplace (owner is AWS Marketplace), self (owner is the sender of the request). Omitting this option returns all images for which you have launch permissions, regardless of ownership.

  • (string) --

type ExecutableUsers

list

param ExecutableUsers

Scopes the images by users with explicit launch permissions. Specify an AWS account ID, self (the sender of the request), or all (public AMIs).

  • (string) --

type Filters

list

param Filters

One or more filters.

  • architecture - The image architecture ( i386 | x86_64 ).

  • block-device-mapping.delete-on-termination - A Boolean value that indicates whether the Amazon EBS volume is deleted on instance termination.

  • block-device-mapping.device-name - The device name for the EBS volume (for example, /dev/sdh ).

  • block-device-mapping.snapshot-id - The ID of the snapshot used for the EBS volume.

  • block-device-mapping.volume-size - The volume size of the EBS volume, in GiB.

  • block-device-mapping.volume-type - The volume type of the EBS volume ( gp2 | io1 | st1 | sc1 | standard ).

  • description - The description of the image (provided during image creation).

  • hypervisor - The hypervisor type ( ovm | xen ).

  • image-id - The ID of the image.

  • image-type - The image type ( machine | kernel | ramdisk ).

  • is-public - A Boolean that indicates whether the image is public.

  • kernel-id - The kernel ID.

  • manifest-location - The location of the image manifest.

  • name - The name of the AMI (provided during image creation).

  • owner-alias - The AWS account alias (for example, amazon ).

  • owner-id - The AWS account ID of the image owner.

  • platform - The platform. To only list Windows-based AMIs, use windows .

  • product-code - The product code.

  • product-code.type - The type of the product code ( devpay | marketplace ).

  • ramdisk-id - The RAM disk ID.

  • root-device-name - The name of the root device volume (for example, /dev/sda1 ).

  • root-device-type - The type of the root device volume ( ebs | instance-store ).

  • state - The state of the image ( available | pending | failed ).

  • state-reason-code - The reason code for the state change.

  • state-reason-message - The message for the state change.

  • tag :key =*value* - The key/value combination of a tag assigned to the resource.

  • tag-key - The key of a tag assigned to the resource. This filter is independent of the tag-value filter. For example, if you use both the filter "tag-key=Purpose" and the filter "tag-value=X", you get any resources assigned both the tag key Purpose (regardless of what the tag's value is), and the tag value X (regardless of what the tag's key is). If you want to list only resources where Purpose is X, see the tag :key =*value* filter.

  • tag-value - The value of a tag assigned to the resource. This filter is independent of the tag-key filter.

  • virtualization-type - The virtualization type ( paravirtual | hvm ).

  • (dict) --

    A filter name and value pair that is used to return a more specific list of results. Filters can be used to match a set of resources by various criteria, such as tags, attributes, or IDs.

    • Name (string) --

      The name of the filter. Filter names are case-sensitive.

    • Values (list) --

      One or more filter values. Filter values are case-sensitive.

      • (string) --

rtype

dict

returns

Response Syntax

{
    'Images': [
        {
            'ImageId': 'string',
            'ImageLocation': 'string',
            'State': 'pending'|'available'|'invalid'|'deregistered'|'transient'|'failed'|'error',
            'OwnerId': 'string',
            'CreationDate': 'string',
            'Public': True|False,
            'ProductCodes': [
                {
                    'ProductCodeId': 'string',
                    'ProductCodeType': 'devpay'|'marketplace'
                },
            ],
            'Architecture': 'i386'|'x86_64',
            'ImageType': 'machine'|'kernel'|'ramdisk',
            'KernelId': 'string',
            'RamdiskId': 'string',
            'Platform': 'Windows',
            'SriovNetSupport': 'string',
            'EnaSupport': True|False,
            'StateReason': {
                'Code': 'string',
                'Message': 'string'
            },
            'ImageOwnerAlias': 'string',
            'Name': 'string',
            'Description': 'string',
            'RootDeviceType': 'ebs'|'instance-store',
            'RootDeviceName': 'string',
            'BlockDeviceMappings': [
                {
                    'VirtualName': 'string',
                    'DeviceName': 'string',
                    'Ebs': {
                        'SnapshotId': 'string',
                        'VolumeSize': 123,
                        'DeleteOnTermination': True|False,
                        'VolumeType': 'standard'|'io1'|'gp2'|'sc1'|'st1',
                        'Iops': 123,
                        'Encrypted': True|False
                    },
                    'NoDevice': 'string'
                },
            ],
            'VirtualizationType': 'hvm'|'paravirtual',
            'Tags': [
                {
                    'Key': 'string',
                    'Value': 'string'
                },
            ],
            'Hypervisor': 'ovm'|'xen'
        },
    ]
}

Response Structure

  • (dict) --

    Contains the output of DescribeImages.

    • Images (list) --

      Information about one or more images.

      • (dict) --

        Describes an image.

        • ImageId (string) --

          The ID of the AMI.

        • ImageLocation (string) --

          The location of the AMI.

        • State (string) --

          The current state of the AMI. If the state is available , the image is successfully registered and can be used to launch an instance.

        • OwnerId (string) --

          The AWS account ID of the image owner.

        • CreationDate (string) --

          The date and time the image was created.

        • Public (boolean) --

          Indicates whether the image has public launch permissions. The value is true if this image has public launch permissions or false if it has only implicit and explicit launch permissions.

        • ProductCodes (list) --

          Any product codes associated with the AMI.

          • (dict) --

            Describes a product code.

            • ProductCodeId (string) --

              The product code.

            • ProductCodeType (string) --

              The type of product code.

        • Architecture (string) --

          The architecture of the image.

        • ImageType (string) --

          The type of image.

        • KernelId (string) --

          The kernel associated with the image, if any. Only applicable for machine images.

        • RamdiskId (string) --

          The RAM disk associated with the image, if any. Only applicable for machine images.

        • Platform (string) --

          The value is Windows for Windows AMIs; otherwise blank.

        • SriovNetSupport (string) --

          Specifies whether enhanced networking with the Intel 82599 Virtual Function interface is enabled.

        • EnaSupport (boolean) --

          Specifies whether enhanced networking with ENA is enabled.

        • StateReason (dict) --

          The reason for the state change.

          • Code (string) --

            The reason code for the state change.

          • Message (string) --

            The message for the state change.

            • Server.SpotInstanceTermination : A Spot instance was terminated due to an increase in the market price.

            • Server.InternalError : An internal error occurred during instance launch, resulting in termination.

            • Server.InsufficientInstanceCapacity : There was insufficient instance capacity to satisfy the launch request.

            • Client.InternalError : A client error caused the instance to terminate on launch.

            • Client.InstanceInitiatedShutdown : The instance was shut down using the shutdown -h command from the instance.

            • Client.UserInitiatedShutdown : The instance was shut down using the Amazon EC2 API.

            • Client.VolumeLimitExceeded : The limit on the number of EBS volumes or total storage was exceeded. Decrease usage or request an increase in your limits.

            • Client.InvalidSnapshot.NotFound : The specified snapshot was not found.

        • ImageOwnerAlias (string) --

          The AWS account alias (for example, amazon , self ) or the AWS account ID of the AMI owner.

        • Name (string) --

          The name of the AMI that was provided during image creation.

        • Description (string) --

          The description of the AMI that was provided during image creation.

        • RootDeviceType (string) --

          The type of root device used by the AMI. The AMI can use an EBS volume or an instance store volume.

        • RootDeviceName (string) --

          The device name of the root device (for example, /dev/sda1 or /dev/xvda ).

        • BlockDeviceMappings (list) --

          Any block device mapping entries.

          • (dict) --

            Describes a block device mapping.

            • VirtualName (string) --

              The virtual device name ( ephemeral N). Instance store volumes are numbered starting from 0. An instance type with 2 available instance store volumes can specify mappings for ephemeral0 and ephemeral1 .The number of available instance store volumes depends on the instance type. After you connect to the instance, you must mount the volume.

              Constraints: For M3 instances, you must specify instance store volumes in the block device mapping for the instance. When you launch an M3 instance, we ignore any instance store volumes specified in the block device mapping for the AMI.

            • DeviceName (string) --

              The device name exposed to the instance (for example, /dev/sdh or xvdh ).

            • Ebs (dict) --

              Parameters used to automatically set up EBS volumes when the instance is launched.

              • SnapshotId (string) --

                The ID of the snapshot.

              • VolumeSize (integer) --

                The size of the volume, in GiB.

                Constraints: 1-16384 for General Purpose SSD ( gp2 ), 4-16384 for Provisioned IOPS SSD ( io1 ), 500-16384 for Throughput Optimized HDD ( st1 ), 500-16384 for Cold HDD ( sc1 ), and 1-1024 for Magnetic ( standard ) volumes. If you specify a snapshot, the volume size must be equal to or larger than the snapshot size.

                Default: If you're creating the volume from a snapshot and don't specify a volume size, the default is the snapshot size.

              • DeleteOnTermination (boolean) --

                Indicates whether the EBS volume is deleted on instance termination.

              • VolumeType (string) --

                The volume type: gp2 , io1 , st1 , sc1 , or standard .

                Default: standard

              • Iops (integer) --

                The number of I/O operations per second (IOPS) that the volume supports. For io1 , this represents the number of IOPS that are provisioned for the volume. For gp2 , this represents the baseline performance of the volume and the rate at which the volume accumulates I/O credits for bursting. For more information about General Purpose SSD baseline performance, I/O credits, and bursting, see Amazon EBS Volume Types in the Amazon Elastic Compute Cloud User Guide .

                Constraint: Range is 100-20000 IOPS for io1 volumes and 100-10000 IOPS for gp2 volumes.

                Condition: This parameter is required for requests to create io1 volumes; it is not used in requests to create gp2 , st1 , sc1 , or standard volumes.

              • Encrypted (boolean) --

                Indicates whether the EBS volume is encrypted. Encrypted Amazon EBS volumes may only be attached to instances that support Amazon EBS encryption.

            • NoDevice (string) --

              Suppresses the specified device included in the block device mapping of the AMI.

        • VirtualizationType (string) --

          The type of virtualization of the AMI.

        • Tags (list) --

          Any tags assigned to the image.

          • (dict) --

            Describes a tag.

            • Key (string) --

              The key of the tag.

              Constraints: Tag keys are case-sensitive and accept a maximum of 127 Unicode characters. May not begin with aws:

            • Value (string) --

              The value of the tag.

              Constraints: Tag values are case-sensitive and accept a maximum of 255 Unicode characters.

        • Hypervisor (string) --

          The hypervisor type of the image.

DescribeInstanceAttribute (updated) Link ¶
Changes (request, response)
Request
{'Attribute': {'enaSupport'}}
Response
{'EnaSupport': {'Value': 'boolean'}}

Describes the specified attribute of the specified instance. You can specify only one attribute at a time. Valid attribute values are: instanceType | kernel | ramdisk | userData | disableApiTermination | instanceInitiatedShutdownBehavior | rootDeviceName | blockDeviceMapping | productCodes | sourceDestCheck | groupSet | ebsOptimized | sriovNetSupport

Request Syntax

client.describe_instance_attribute(
    DryRun=True|False,
    InstanceId='string',
    Attribute='instanceType'|'kernel'|'ramdisk'|'userData'|'disableApiTermination'|'instanceInitiatedShutdownBehavior'|'rootDeviceName'|'blockDeviceMapping'|'productCodes'|'sourceDestCheck'|'groupSet'|'ebsOptimized'|'sriovNetSupport'|'enaSupport'
)
type DryRun

boolean

param DryRun

Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation . Otherwise, it is UnauthorizedOperation .

type InstanceId

string

param InstanceId

[REQUIRED]

The ID of the instance.

type Attribute

string

param Attribute

[REQUIRED]

The instance attribute.

Note: The enaSupport attribute is not supported at this time.

rtype

dict

returns

Response Syntax

{
    'InstanceId': 'string',
    'InstanceType': {
        'Value': 'string'
    },
    'KernelId': {
        'Value': 'string'
    },
    'RamdiskId': {
        'Value': 'string'
    },
    'UserData': {
        'Value': 'string'
    },
    'DisableApiTermination': {
        'Value': True|False
    },
    'InstanceInitiatedShutdownBehavior': {
        'Value': 'string'
    },
    'RootDeviceName': {
        'Value': 'string'
    },
    'BlockDeviceMappings': [
        {
            'DeviceName': 'string',
            'Ebs': {
                'VolumeId': 'string',
                'Status': 'attaching'|'attached'|'detaching'|'detached',
                'AttachTime': datetime(2015, 1, 1),
                'DeleteOnTermination': True|False
            }
        },
    ],
    'ProductCodes': [
        {
            'ProductCodeId': 'string',
            'ProductCodeType': 'devpay'|'marketplace'
        },
    ],
    'EbsOptimized': {
        'Value': True|False
    },
    'SriovNetSupport': {
        'Value': 'string'
    },
    'EnaSupport': {
        'Value': True|False
    },
    'SourceDestCheck': {
        'Value': True|False
    },
    'Groups': [
        {
            'GroupName': 'string',
            'GroupId': 'string'
        },
    ]
}

Response Structure

  • (dict) --

    Describes an instance attribute.

    • InstanceId (string) --

      The ID of the instance.

    • InstanceType (dict) --

      The instance type.

      • Value (string) --

        The attribute value. Note that the value is case-sensitive.

    • KernelId (dict) --

      The kernel ID.

      • Value (string) --

        The attribute value. Note that the value is case-sensitive.

    • RamdiskId (dict) --

      The RAM disk ID.

      • Value (string) --

        The attribute value. Note that the value is case-sensitive.

    • UserData (dict) --

      The user data.

      • Value (string) --

        The attribute value. Note that the value is case-sensitive.

    • DisableApiTermination (dict) --

      If the value is true , you can't terminate the instance through the Amazon EC2 console, CLI, or API; otherwise, you can.

      • Value (boolean) --

        The attribute value. The valid values are true or false .

    • InstanceInitiatedShutdownBehavior (dict) --

      Indicates whether an instance stops or terminates when you initiate shutdown from the instance (using the operating system command for system shutdown).

      • Value (string) --

        The attribute value. Note that the value is case-sensitive.

    • RootDeviceName (dict) --

      The name of the root device (for example, /dev/sda1 or /dev/xvda ).

      • Value (string) --

        The attribute value. Note that the value is case-sensitive.

    • BlockDeviceMappings (list) --

      The block device mapping of the instance.

      • (dict) --

        Describes a block device mapping.

        • DeviceName (string) --

          The device name exposed to the instance (for example, /dev/sdh or xvdh ).

        • Ebs (dict) --

          Parameters used to automatically set up EBS volumes when the instance is launched.

          • VolumeId (string) --

            The ID of the EBS volume.

          • Status (string) --

            The attachment state.

          • AttachTime (datetime) --

            The time stamp when the attachment initiated.

          • DeleteOnTermination (boolean) --

            Indicates whether the volume is deleted on instance termination.

    • ProductCodes (list) --

      A list of product codes.

      • (dict) --

        Describes a product code.

        • ProductCodeId (string) --

          The product code.

        • ProductCodeType (string) --

          The type of product code.

    • EbsOptimized (dict) --

      Indicates whether the instance is optimized for EBS I/O.

      • Value (boolean) --

        The attribute value. The valid values are true or false .

    • SriovNetSupport (dict) --

      Indicates whether enhanced networking with the Intel 82599 Virtual Function interface is enabled.

      • Value (string) --

        The attribute value. Note that the value is case-sensitive.

    • EnaSupport (dict) --

      Indicates whether enhanced networking with ENA is enabled.

      • Value (boolean) --

        The attribute value. The valid values are true or false .

    • SourceDestCheck (dict) --

      Indicates whether source/destination checking is enabled. A value of true means checking is enabled, and false means checking is disabled. This value must be false for a NAT instance to perform NAT.

      • Value (boolean) --

        The attribute value. The valid values are true or false .

    • Groups (list) --

      The security groups associated with the instance.

      • (dict) --

        Describes a security group.

        • GroupName (string) --

          The name of the security group.

        • GroupId (string) --

          The ID of the security group.

DescribeInstances (updated) Link ¶
Changes (response)
{'Reservations': {'Instances': {'EnaSupport': 'boolean'}}}

Describes one or more of your instances.

If you specify one or more instance IDs, Amazon EC2 returns information for those instances. If you do not specify instance IDs, Amazon EC2 returns information for all relevant instances. If you specify an instance ID that is not valid, an error is returned. If you specify an instance that you do not own, it is not included in the returned results.

Recently terminated instances might appear in the returned results. This interval is usually less than one hour.

If you describe instances in the rare case where an Availability Zone is experiencing a service disruption and you specify instance IDs that are in the affected zone, or do not specify any instance IDs at all, the call fails. If you describe instances and specify only instance IDs that are in an unaffected zone, the call works normally.

Request Syntax

client.describe_instances(
    DryRun=True|False,
    InstanceIds=[
        'string',
    ],
    Filters=[
        {
            'Name': 'string',
            'Values': [
                'string',
            ]
        },
    ],
    NextToken='string',
    MaxResults=123
)
type DryRun

boolean

param DryRun

Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation . Otherwise, it is UnauthorizedOperation .

type InstanceIds

list

param InstanceIds

One or more instance IDs.

Default: Describes all your instances.

  • (string) --

type Filters

list

param Filters

One or more filters.

  • affinity - The affinity setting for an instance running on a Dedicated host ( default | host ).

  • architecture - The instance architecture ( i386 | x86_64 ).

  • availability-zone - The Availability Zone of the instance.

  • block-device-mapping.attach-time - The attach time for an EBS volume mapped to the instance, for example, 2010-09-15T17:15:20.000Z .

  • block-device-mapping.delete-on-termination - A Boolean that indicates whether the EBS volume is deleted on instance termination.

  • block-device-mapping.device-name - The device name for the EBS volume (for example, /dev/sdh or xvdh ).

  • block-device-mapping.status - The status for the EBS volume ( attaching | attached | detaching | detached ).

  • block-device-mapping.volume-id - The volume ID of the EBS volume.

  • client-token - The idempotency token you provided when you launched the instance.

  • dns-name - The public DNS name of the instance.

  • group-id - The ID of the security group for the instance. EC2-Classic only.

  • group-name - The name of the security group for the instance. EC2-Classic only.

  • host-Id - The ID of the Dedicated host on which the instance is running, if applicable.

  • hypervisor - The hypervisor type of the instance ( ovm | xen ).

  • iam-instance-profile.arn - The instance profile associated with the instance. Specified as an ARN.

  • image-id - The ID of the image used to launch the instance.

  • instance-id - The ID of the instance.

  • instance-lifecycle - Indicates whether this is a Spot Instance or a Scheduled Instance ( spot | scheduled ).

  • instance-state-code - The state of the instance, as a 16-bit unsigned integer. The high byte is an opaque internal value and should be ignored. The low byte is set based on the state represented. The valid values are: 0 (pending), 16 (running), 32 (shutting-down), 48 (terminated), 64 (stopping), and 80 (stopped).

  • instance-state-name - The state of the instance ( pending | running | shutting-down | terminated | stopping | stopped ).

  • instance-type - The type of instance (for example, t2.micro ).

  • instance.group-id - The ID of the security group for the instance.

  • instance.group-name - The name of the security group for the instance.

  • ip-address - The public IP address of the instance.

  • kernel-id - The kernel ID.

  • key-name - The name of the key pair used when the instance was launched.

  • launch-index - When launching multiple instances, this is the index for the instance in the launch group (for example, 0, 1, 2, and so on).

  • launch-time - The time when the instance was launched.

  • monitoring-state - Indicates whether monitoring is enabled for the instance ( disabled | enabled ).

  • owner-id - The AWS account ID of the instance owner.

  • placement-group-name - The name of the placement group for the instance.

  • platform - The platform. Use windows if you have Windows instances; otherwise, leave blank.

  • private-dns-name - The private DNS name of the instance.

  • private-ip-address - The private IP address of the instance.

  • product-code - The product code associated with the AMI used to launch the instance.

  • product-code.type - The type of product code ( devpay | marketplace ).

  • ramdisk-id - The RAM disk ID.

  • reason - The reason for the current state of the instance (for example, shows "User Initiated [date]" when you stop or terminate the instance). Similar to the state-reason-code filter.

  • requester-id - The ID of the entity that launched the instance on your behalf (for example, AWS Management Console, Auto Scaling, and so on).

  • reservation-id - The ID of the instance's reservation. A reservation ID is created any time you launch an instance. A reservation ID has a one-to-one relationship with an instance launch request, but can be associated with more than one instance if you launch multiple instances using the same launch request. For example, if you launch one instance, you'll get one reservation ID. If you launch ten instances using the same launch request, you'll also get one reservation ID.

  • root-device-name - The name of the root device for the instance (for example, /dev/sda1 or /dev/xvda ).

  • root-device-type - The type of root device that the instance uses ( ebs | instance-store ).

  • source-dest-check - Indicates whether the instance performs source/destination checking. A value of true means that checking is enabled, and false means checking is disabled. The value must be false for the instance to perform network address translation (NAT) in your VPC.

  • spot-instance-request-id - The ID of the Spot instance request.

  • state-reason-code - The reason code for the state change.

  • state-reason-message - A message that describes the state change.

  • subnet-id - The ID of the subnet for the instance.

  • tag :key =*value* - The key/value combination of a tag assigned to the resource, where tag :key is the tag's key.

  • tag-key - The key of a tag assigned to the resource. This filter is independent of the tag-value filter. For example, if you use both the filter "tag-key=Purpose" and the filter "tag-value=X", you get any resources assigned both the tag key Purpose (regardless of what the tag's value is), and the tag value X (regardless of what the tag's key is). If you want to list only resources where Purpose is X, see the tag :key =*value* filter.

  • tag-value - The value of a tag assigned to the resource. This filter is independent of the tag-key filter.

  • tenancy - The tenancy of an instance ( dedicated | default | host ).

  • virtualization-type - The virtualization type of the instance ( paravirtual | hvm ).

  • vpc-id - The ID of the VPC that the instance is running in.

  • network-interface.description - The description of the network interface.

  • network-interface.subnet-id - The ID of the subnet for the network interface.

  • network-interface.vpc-id - The ID of the VPC for the network interface.

  • network-interface.network-interface-id - The ID of the network interface.

  • network-interface.owner-id - The ID of the owner of the network interface.

  • network-interface.availability-zone - The Availability Zone for the network interface.

  • network-interface.requester-id - The requester ID for the network interface.

  • network-interface.requester-managed - Indicates whether the network interface is being managed by AWS.

  • network-interface.status - The status of the network interface ( available ) | in-use ).

  • network-interface.mac-address - The MAC address of the network interface.

  • network-interface.private-dns-name - The private DNS name of the network interface.

  • network-interface.source-dest-check - Whether the network interface performs source/destination checking. A value of true means checking is enabled, and false means checking is disabled. The value must be false for the network interface to perform network address translation (NAT) in your VPC.

  • network-interface.group-id - The ID of a security group associated with the network interface.

  • network-interface.group-name - The name of a security group associated with the network interface.

  • network-interface.attachment.attachment-id - The ID of the interface attachment.

  • network-interface.attachment.instance-id - The ID of the instance to which the network interface is attached.

  • network-interface.attachment.instance-owner-id - The owner ID of the instance to which the network interface is attached.

  • network-interface.addresses.private-ip-address - The private IP address associated with the network interface.

  • network-interface.attachment.device-index - The device index to which the network interface is attached.

  • network-interface.attachment.status - The status of the attachment ( attaching | attached | detaching | detached ).

  • network-interface.attachment.attach-time - The time that the network interface was attached to an instance.

  • network-interface.attachment.delete-on-termination - Specifies whether the attachment is deleted when an instance is terminated.

  • network-interface.addresses.primary - Specifies whether the IP address of the network interface is the primary private IP address.

  • network-interface.addresses.association.public-ip - The ID of the association of an Elastic IP address with a network interface.

  • network-interface.addresses.association.ip-owner-id - The owner ID of the private IP address associated with the network interface.

  • association.public-ip - The address of the Elastic IP address bound to the network interface.

  • association.ip-owner-id - The owner of the Elastic IP address associated with the network interface.

  • association.allocation-id - The allocation ID returned when you allocated the Elastic IP address for your network interface.

  • association.association-id - The association ID returned when the network interface was associated with an IP address.

  • (dict) --

    A filter name and value pair that is used to return a more specific list of results. Filters can be used to match a set of resources by various criteria, such as tags, attributes, or IDs.

    • Name (string) --

      The name of the filter. Filter names are case-sensitive.

    • Values (list) --

      One or more filter values. Filter values are case-sensitive.

      • (string) --

type NextToken

string

param NextToken

The token to request the next page of results.

type MaxResults

integer

param MaxResults

The maximum number of results to return in a single call. To retrieve the remaining results, make another call with the returned NextToken value. This value can be between 5 and 1000. You cannot specify this parameter and the instance IDs parameter or tag filters in the same call.

rtype

dict

returns

Response Syntax

{
    'Reservations': [
        {
            'ReservationId': 'string',
            'OwnerId': 'string',
            'RequesterId': 'string',
            'Groups': [
                {
                    'GroupName': 'string',
                    'GroupId': 'string'
                },
            ],
            'Instances': [
                {
                    'InstanceId': 'string',
                    'ImageId': 'string',
                    'State': {
                        'Code': 123,
                        'Name': 'pending'|'running'|'shutting-down'|'terminated'|'stopping'|'stopped'
                    },
                    'PrivateDnsName': 'string',
                    'PublicDnsName': 'string',
                    'StateTransitionReason': 'string',
                    'KeyName': 'string',
                    'AmiLaunchIndex': 123,
                    'ProductCodes': [
                        {
                            'ProductCodeId': 'string',
                            'ProductCodeType': 'devpay'|'marketplace'
                        },
                    ],
                    'InstanceType': 't1.micro'|'t2.nano'|'t2.micro'|'t2.small'|'t2.medium'|'t2.large'|'m1.small'|'m1.medium'|'m1.large'|'m1.xlarge'|'m3.medium'|'m3.large'|'m3.xlarge'|'m3.2xlarge'|'m4.large'|'m4.xlarge'|'m4.2xlarge'|'m4.4xlarge'|'m4.10xlarge'|'m2.xlarge'|'m2.2xlarge'|'m2.4xlarge'|'cr1.8xlarge'|'r3.large'|'r3.xlarge'|'r3.2xlarge'|'r3.4xlarge'|'r3.8xlarge'|'x1.4xlarge'|'x1.8xlarge'|'x1.16xlarge'|'x1.32xlarge'|'i2.xlarge'|'i2.2xlarge'|'i2.4xlarge'|'i2.8xlarge'|'hi1.4xlarge'|'hs1.8xlarge'|'c1.medium'|'c1.xlarge'|'c3.large'|'c3.xlarge'|'c3.2xlarge'|'c3.4xlarge'|'c3.8xlarge'|'c4.large'|'c4.xlarge'|'c4.2xlarge'|'c4.4xlarge'|'c4.8xlarge'|'cc1.4xlarge'|'cc2.8xlarge'|'g2.2xlarge'|'g2.8xlarge'|'cg1.4xlarge'|'d2.xlarge'|'d2.2xlarge'|'d2.4xlarge'|'d2.8xlarge',
                    'LaunchTime': datetime(2015, 1, 1),
                    'Placement': {
                        'AvailabilityZone': 'string',
                        'GroupName': 'string',
                        'Tenancy': 'default'|'dedicated'|'host',
                        'HostId': 'string',
                        'Affinity': 'string'
                    },
                    'KernelId': 'string',
                    'RamdiskId': 'string',
                    'Platform': 'Windows',
                    'Monitoring': {
                        'State': 'disabled'|'disabling'|'enabled'|'pending'
                    },
                    'SubnetId': 'string',
                    'VpcId': 'string',
                    'PrivateIpAddress': 'string',
                    'PublicIpAddress': 'string',
                    'StateReason': {
                        'Code': 'string',
                        'Message': 'string'
                    },
                    'Architecture': 'i386'|'x86_64',
                    'RootDeviceType': 'ebs'|'instance-store',
                    'RootDeviceName': 'string',
                    'BlockDeviceMappings': [
                        {
                            'DeviceName': 'string',
                            'Ebs': {
                                'VolumeId': 'string',
                                'Status': 'attaching'|'attached'|'detaching'|'detached',
                                'AttachTime': datetime(2015, 1, 1),
                                'DeleteOnTermination': True|False
                            }
                        },
                    ],
                    'VirtualizationType': 'hvm'|'paravirtual',
                    'InstanceLifecycle': 'spot'|'scheduled',
                    'SpotInstanceRequestId': 'string',
                    'ClientToken': 'string',
                    'Tags': [
                        {
                            'Key': 'string',
                            'Value': 'string'
                        },
                    ],
                    'SecurityGroups': [
                        {
                            'GroupName': 'string',
                            'GroupId': 'string'
                        },
                    ],
                    'SourceDestCheck': True|False,
                    'Hypervisor': 'ovm'|'xen',
                    'NetworkInterfaces': [
                        {
                            'NetworkInterfaceId': 'string',
                            'SubnetId': 'string',
                            'VpcId': 'string',
                            'Description': 'string',
                            'OwnerId': 'string',
                            'Status': 'available'|'attaching'|'in-use'|'detaching',
                            'MacAddress': 'string',
                            'PrivateIpAddress': 'string',
                            'PrivateDnsName': 'string',
                            'SourceDestCheck': True|False,
                            'Groups': [
                                {
                                    'GroupName': 'string',
                                    'GroupId': 'string'
                                },
                            ],
                            'Attachment': {
                                'AttachmentId': 'string',
                                'DeviceIndex': 123,
                                'Status': 'attaching'|'attached'|'detaching'|'detached',
                                'AttachTime': datetime(2015, 1, 1),
                                'DeleteOnTermination': True|False
                            },
                            'Association': {
                                'PublicIp': 'string',
                                'PublicDnsName': 'string',
                                'IpOwnerId': 'string'
                            },
                            'PrivateIpAddresses': [
                                {
                                    'PrivateIpAddress': 'string',
                                    'PrivateDnsName': 'string',
                                    'Primary': True|False,
                                    'Association': {
                                        'PublicIp': 'string',
                                        'PublicDnsName': 'string',
                                        'IpOwnerId': 'string'
                                    }
                                },
                            ]
                        },
                    ],
                    'IamInstanceProfile': {
                        'Arn': 'string',
                        'Id': 'string'
                    },
                    'EbsOptimized': True|False,
                    'SriovNetSupport': 'string',
                    'EnaSupport': True|False
                },
            ]
        },
    ],
    'NextToken': 'string'
}

Response Structure

  • (dict) --

    Contains the output of DescribeInstances.

    • Reservations (list) --

      Zero or more reservations.

      • (dict) --

        Describes a reservation.

        • ReservationId (string) --

          The ID of the reservation.

        • OwnerId (string) --

          The ID of the AWS account that owns the reservation.

        • RequesterId (string) --

          The ID of the requester that launched the instances on your behalf (for example, AWS Management Console or Auto Scaling).

        • Groups (list) --

          [EC2-Classic only] One or more security groups.

          • (dict) --

            Describes a security group.

            • GroupName (string) --

              The name of the security group.

            • GroupId (string) --

              The ID of the security group.

        • Instances (list) --

          One or more instances.

          • (dict) --

            Describes an instance.

            • InstanceId (string) --

              The ID of the instance.

            • ImageId (string) --

              The ID of the AMI used to launch the instance.

            • State (dict) --

              The current state of the instance.

              • Code (integer) --

                The low byte represents the state. The high byte is an opaque internal value and should be ignored.

                • 0 : pending

                • 16 : running

                • 32 : shutting-down

                • 48 : terminated

                • 64 : stopping

                • 80 : stopped

              • Name (string) --

                The current state of the instance.

            • PrivateDnsName (string) --

              The private DNS name assigned to the instance. This DNS name can only be used inside the Amazon EC2 network. This name is not available until the instance enters the running state. For EC2-VPC, this name is only available if you've enabled DNS hostnames for your VPC.

            • PublicDnsName (string) --

              The public DNS name assigned to the instance. This name is not available until the instance enters the running state. For EC2-VPC, this name is only available if you've enabled DNS hostnames for your VPC.

            • StateTransitionReason (string) --

              The reason for the most recent state transition. This might be an empty string.

            • KeyName (string) --

              The name of the key pair, if this instance was launched with an associated key pair.

            • AmiLaunchIndex (integer) --

              The AMI launch index, which can be used to find this instance in the launch group.

            • ProductCodes (list) --

              The product codes attached to this instance, if applicable.

              • (dict) --

                Describes a product code.

                • ProductCodeId (string) --

                  The product code.

                • ProductCodeType (string) --

                  The type of product code.

            • InstanceType (string) --

              The instance type.

            • LaunchTime (datetime) --

              The time the instance was launched.

            • Placement (dict) --

              The location where the instance launched, if applicable.

              • AvailabilityZone (string) --

                The Availability Zone of the instance.

              • GroupName (string) --

                The name of the placement group the instance is in (for cluster compute instances).

              • Tenancy (string) --

                The tenancy of the instance (if the instance is running in a VPC). An instance with a tenancy of dedicated runs on single-tenant hardware. The host tenancy is not supported for the ImportInstance command.

              • HostId (string) --

                The ID of the Dedicted host on which the instance resides. This parameter is not support for the ImportInstance command.

              • Affinity (string) --

                The affinity setting for the instance on the Dedicated host. This parameter is not supported for the ImportInstance command.

            • KernelId (string) --

              The kernel associated with this instance, if applicable.

            • RamdiskId (string) --

              The RAM disk associated with this instance, if applicable.

            • Platform (string) --

              The value is Windows for Windows instances; otherwise blank.

            • Monitoring (dict) --

              The monitoring information for the instance.

              • State (string) --

                Indicates whether monitoring is enabled for the instance.

            • SubnetId (string) --

              [EC2-VPC] The ID of the subnet in which the instance is running.

            • VpcId (string) --

              [EC2-VPC] The ID of the VPC in which the instance is running.

            • PrivateIpAddress (string) --

              The private IP address assigned to the instance.

            • PublicIpAddress (string) --

              The public IP address assigned to the instance, if applicable.

            • StateReason (dict) --

              The reason for the most recent state transition.

              • Code (string) --

                The reason code for the state change.

              • Message (string) --

                The message for the state change.

                • Server.SpotInstanceTermination : A Spot instance was terminated due to an increase in the market price.

                • Server.InternalError : An internal error occurred during instance launch, resulting in termination.

                • Server.InsufficientInstanceCapacity : There was insufficient instance capacity to satisfy the launch request.

                • Client.InternalError : A client error caused the instance to terminate on launch.

                • Client.InstanceInitiatedShutdown : The instance was shut down using the shutdown -h command from the instance.

                • Client.UserInitiatedShutdown : The instance was shut down using the Amazon EC2 API.

                • Client.VolumeLimitExceeded : The limit on the number of EBS volumes or total storage was exceeded. Decrease usage or request an increase in your limits.

                • Client.InvalidSnapshot.NotFound : The specified snapshot was not found.

            • Architecture (string) --

              The architecture of the image.

            • RootDeviceType (string) --

              The root device type used by the AMI. The AMI can use an EBS volume or an instance store volume.

            • RootDeviceName (string) --

              The root device name (for example, /dev/sda1 or /dev/xvda ).

            • BlockDeviceMappings (list) --

              Any block device mapping entries for the instance.

              • (dict) --

                Describes a block device mapping.

                • DeviceName (string) --

                  The device name exposed to the instance (for example, /dev/sdh or xvdh ).

                • Ebs (dict) --

                  Parameters used to automatically set up EBS volumes when the instance is launched.

                  • VolumeId (string) --

                    The ID of the EBS volume.

                  • Status (string) --

                    The attachment state.

                  • AttachTime (datetime) --

                    The time stamp when the attachment initiated.

                  • DeleteOnTermination (boolean) --

                    Indicates whether the volume is deleted on instance termination.

            • VirtualizationType (string) --

              The virtualization type of the instance.

            • InstanceLifecycle (string) --

              Indicates whether this is a Spot instance or a Scheduled Instance.

            • SpotInstanceRequestId (string) --

              If the request is a Spot instance request, the ID of the request.

            • ClientToken (string) --

              The idempotency token you provided when you launched the instance, if applicable.

            • Tags (list) --

              Any tags assigned to the instance.

              • (dict) --

                Describes a tag.

                • Key (string) --

                  The key of the tag.

                  Constraints: Tag keys are case-sensitive and accept a maximum of 127 Unicode characters. May not begin with aws:

                • Value (string) --

                  The value of the tag.

                  Constraints: Tag values are case-sensitive and accept a maximum of 255 Unicode characters.

            • SecurityGroups (list) --

              One or more security groups for the instance.

              • (dict) --

                Describes a security group.

                • GroupName (string) --

                  The name of the security group.

                • GroupId (string) --

                  The ID of the security group.

            • SourceDestCheck (boolean) --

              Specifies whether to enable an instance launched in a VPC to perform NAT. This controls whether source/destination checking is enabled on the instance. A value of true means checking is enabled, and false means checking is disabled. The value must be false for the instance to perform NAT. For more information, see NAT Instances in the Amazon Virtual Private Cloud User Guide .

            • Hypervisor (string) --

              The hypervisor type of the instance.

            • NetworkInterfaces (list) --

              [EC2-VPC] One or more network interfaces for the instance.

              • (dict) --

                Describes a network interface.

                • NetworkInterfaceId (string) --

                  The ID of the network interface.

                • SubnetId (string) --

                  The ID of the subnet.

                • VpcId (string) --

                  The ID of the VPC.

                • Description (string) --

                  The description.

                • OwnerId (string) --

                  The ID of the AWS account that created the network interface.

                • Status (string) --

                  The status of the network interface.

                • MacAddress (string) --

                  The MAC address.

                • PrivateIpAddress (string) --

                  The IP address of the network interface within the subnet.

                • PrivateDnsName (string) --

                  The private DNS name.

                • SourceDestCheck (boolean) --

                  Indicates whether to validate network traffic to or from this network interface.

                • Groups (list) --

                  One or more security groups.

                  • (dict) --

                    Describes a security group.

                    • GroupName (string) --

                      The name of the security group.

                    • GroupId (string) --

                      The ID of the security group.

                • Attachment (dict) --

                  The network interface attachment.

                  • AttachmentId (string) --

                    The ID of the network interface attachment.

                  • DeviceIndex (integer) --

                    The index of the device on the instance for the network interface attachment.

                  • Status (string) --

                    The attachment state.

                  • AttachTime (datetime) --

                    The time stamp when the attachment initiated.

                  • DeleteOnTermination (boolean) --

                    Indicates whether the network interface is deleted when the instance is terminated.

                • Association (dict) --

                  The association information for an Elastic IP associated with the network interface.

                  • PublicIp (string) --

                    The public IP address or Elastic IP address bound to the network interface.

                  • PublicDnsName (string) --

                    The public DNS name.

                  • IpOwnerId (string) --

                    The ID of the owner of the Elastic IP address.

                • PrivateIpAddresses (list) --

                  The private IP addresses associated with the network interface.

                  • (dict) --

                    Describes a private IP address.

                    • PrivateIpAddress (string) --

                      The private IP address of the network interface.

                    • PrivateDnsName (string) --

                      The private DNS name.

                    • Primary (boolean) --

                      Indicates whether this IP address is the primary private IP address of the network interface.

                    • Association (dict) --

                      The association information for an Elastic IP address for the network interface.

                      • PublicIp (string) --

                        The public IP address or Elastic IP address bound to the network interface.

                      • PublicDnsName (string) --

                        The public DNS name.

                      • IpOwnerId (string) --

                        The ID of the owner of the Elastic IP address.

            • IamInstanceProfile (dict) --

              The IAM instance profile associated with the instance, if applicable.

              • Arn (string) --

                The Amazon Resource Name (ARN) of the instance profile.

              • Id (string) --

                The ID of the instance profile.

            • EbsOptimized (boolean) --

              Indicates whether the instance is optimized for EBS I/O. This optimization provides dedicated throughput to Amazon EBS and an optimized configuration stack to provide optimal I/O performance. This optimization isn't available with all instance types. Additional usage charges apply when using an EBS Optimized instance.

            • SriovNetSupport (string) --

              Specifies whether enhanced networking with the Intel 82599 Virtual Function interface is enabled.

            • EnaSupport (boolean) --

              Specifies whether enhanced networking with ENA is enabled.

    • NextToken (string) --

      The token to use to retrieve the next page of results. This value is null when there are no more results to return.

ModifyInstanceAttribute (updated) Link ¶
Changes (request)
{'Attribute': {'enaSupport'}, 'EnaSupport': {'Value': 'boolean'}}

Modifies the specified attribute of the specified instance. You can specify only one attribute at a time.

To modify some attributes, the instance must be stopped. For more information, see Modifying Attributes of a Stopped Instance in the Amazon Elastic Compute Cloud User Guide .

Request Syntax

client.modify_instance_attribute(
    DryRun=True|False,
    InstanceId='string',
    Attribute='instanceType'|'kernel'|'ramdisk'|'userData'|'disableApiTermination'|'instanceInitiatedShutdownBehavior'|'rootDeviceName'|'blockDeviceMapping'|'productCodes'|'sourceDestCheck'|'groupSet'|'ebsOptimized'|'sriovNetSupport'|'enaSupport',
    Value='string',
    BlockDeviceMappings=[
        {
            'DeviceName': 'string',
            'Ebs': {
                'VolumeId': 'string',
                'DeleteOnTermination': True|False
            },
            'VirtualName': 'string',
            'NoDevice': 'string'
        },
    ],
    SourceDestCheck={
        'Value': True|False
    },
    DisableApiTermination={
        'Value': True|False
    },
    InstanceType={
        'Value': 'string'
    },
    Kernel={
        'Value': 'string'
    },
    Ramdisk={
        'Value': 'string'
    },
    UserData={
        'Value': b'bytes'
    },
    InstanceInitiatedShutdownBehavior={
        'Value': 'string'
    },
    Groups=[
        'string',
    ],
    EbsOptimized={
        'Value': True|False
    },
    SriovNetSupport={
        'Value': 'string'
    },
    EnaSupport={
        'Value': True|False
    }
)
type DryRun

boolean

param DryRun

Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation . Otherwise, it is UnauthorizedOperation .

type InstanceId

string

param InstanceId

[REQUIRED]

The ID of the instance.

type Attribute

string

param Attribute

The name of the attribute.

type Value

string

param Value

A new value for the attribute. Use only with the kernel , ramdisk , userData , disableApiTermination , or instanceInitiatedShutdownBehavior attribute.

type BlockDeviceMappings

list

param BlockDeviceMappings

Modifies the DeleteOnTermination attribute for volumes that are currently attached. The volume must be owned by the caller. If no value is specified for DeleteOnTermination , the default is true and the volume is deleted when the instance is terminated.

To add instance store volumes to an Amazon EBS-backed instance, you must add them when you launch the instance. For more information, see Updating the Block Device Mapping when Launching an Instance in the Amazon Elastic Compute Cloud User Guide .

  • (dict) --

    Describes a block device mapping entry.

    • DeviceName (string) --

      The device name exposed to the instance (for example, /dev/sdh or xvdh ).

    • Ebs (dict) --

      Parameters used to automatically set up EBS volumes when the instance is launched.

      • VolumeId (string) --

        The ID of the EBS volume.

      • DeleteOnTermination (boolean) --

        Indicates whether the volume is deleted on instance termination.

    • VirtualName (string) --

      The virtual device name.

    • NoDevice (string) --

      suppress the specified device included in the block device mapping.

type SourceDestCheck

dict

param SourceDestCheck

Specifies whether source/destination checking is enabled. A value of true means that checking is enabled, and false means checking is disabled. This value must be false for a NAT instance to perform NAT.

  • Value (boolean) --

    The attribute value. The valid values are true or false .

type DisableApiTermination

dict

param DisableApiTermination

If the value is true , you can't terminate the instance using the Amazon EC2 console, CLI, or API; otherwise, you can. You cannot use this paramater for Spot Instances.

  • Value (boolean) --

    The attribute value. The valid values are true or false .

type InstanceType

dict

param InstanceType

Changes the instance type to the specified value. For more information, see Instance Types. If the instance type is not valid, the error returned is InvalidInstanceAttributeValue .

  • Value (string) --

    The attribute value. Note that the value is case-sensitive.

type Kernel

dict

param Kernel

Changes the instance's kernel to the specified value. We recommend that you use PV-GRUB instead of kernels and RAM disks. For more information, see PV-GRUB.

  • Value (string) --

    The attribute value. Note that the value is case-sensitive.

type Ramdisk

dict

param Ramdisk

Changes the instance's RAM disk to the specified value. We recommend that you use PV-GRUB instead of kernels and RAM disks. For more information, see PV-GRUB.

  • Value (string) --

    The attribute value. Note that the value is case-sensitive.

type UserData

dict

param UserData

Changes the instance's user data to the specified value. If you are using an AWS SDK or command line tool, Base64-encoding is performed for you, and you can load the text from a file. Otherwise, you must provide Base64-encoded text.

  • Value (bytes) --

type InstanceInitiatedShutdownBehavior

dict

param InstanceInitiatedShutdownBehavior

Specifies whether an instance stops or terminates when you initiate shutdown from the instance (using the operating system command for system shutdown).

  • Value (string) --

    The attribute value. Note that the value is case-sensitive.

type Groups

list

param Groups

[EC2-VPC] Changes the security groups of the instance. You must specify at least one security group, even if it's just the default security group for the VPC. You must specify the security group ID, not the security group name.

  • (string) --

type EbsOptimized

dict

param EbsOptimized

Specifies whether the instance is optimized for EBS I/O. This optimization provides dedicated throughput to Amazon EBS and an optimized configuration stack to provide optimal EBS I/O performance. This optimization isn't available with all instance types. Additional usage charges apply when using an EBS Optimized instance.

  • Value (boolean) --

    The attribute value. The valid values are true or false .

type SriovNetSupport

dict

param SriovNetSupport

Set to simple to enable enhanced networking with the Intel 82599 Virtual Function interface for the instance.

There is no way to disable enhanced networking with the Intel 82599 Virtual Function interface at this time.

This option is supported only for HVM instances. Specifying this option with a PV instance can make it unreachable.

  • Value (string) --

    The attribute value. Note that the value is case-sensitive.

type EnaSupport

dict

param EnaSupport

Set to true to enable enhanced networking with ENA for the instance.

This option is supported only for HVM instances. Specifying this option with a PV instance can make it unreachable.

  • Value (boolean) --

    The attribute value. The valid values are true or false .

returns

None

RegisterImage (updated) Link ¶
Changes (request)
{'EnaSupport': 'boolean'}

Registers an AMI. When you're creating an AMI, this is the final step you must complete before you can launch an instance from the AMI. For more information about creating AMIs, see Creating Your Own AMIs in the Amazon Elastic Compute Cloud User Guide .

Note

For Amazon EBS-backed instances, CreateImage creates and registers the AMI in a single request, so you don't have to register the AMI yourself.

You can also use RegisterImage to create an Amazon EBS-backed Linux AMI from a snapshot of a root device volume. For more information, see Launching an Instance from a Snapshot in the Amazon Elastic Compute Cloud User Guide .

Warning

Some Linux distributions, such as Red Hat Enterprise Linux (RHEL) and SUSE Linux Enterprise Server (SLES), use the EC2 billingProduct code associated with an AMI to verify subscription status for package updates. Creating an AMI from an EBS snapshot does not maintain this billing code, and subsequent instances launched from such an AMI will not be able to connect to package update infrastructure.

Similarly, although you can create a Windows AMI from a snapshot, you can't successfully launch an instance from the AMI.

To create Windows AMIs or to create AMIs for Linux operating systems that must retain AMI billing codes to work properly, see CreateImage.

If needed, you can deregister an AMI at any time. Any modifications you make to an AMI backed by an instance store volume invalidates its registration. If you make changes to an image, deregister the previous image and register the new image.

Note

You can't register an image where a secondary (non-root) snapshot has AWS Marketplace product codes.

Request Syntax

client.register_image(
    DryRun=True|False,
    ImageLocation='string',
    Name='string',
    Description='string',
    Architecture='i386'|'x86_64',
    KernelId='string',
    RamdiskId='string',
    RootDeviceName='string',
    BlockDeviceMappings=[
        {
            'VirtualName': 'string',
            'DeviceName': 'string',
            'Ebs': {
                'SnapshotId': 'string',
                'VolumeSize': 123,
                'DeleteOnTermination': True|False,
                'VolumeType': 'standard'|'io1'|'gp2'|'sc1'|'st1',
                'Iops': 123,
                'Encrypted': True|False
            },
            'NoDevice': 'string'
        },
    ],
    VirtualizationType='string',
    SriovNetSupport='string',
    EnaSupport=True|False
)
type DryRun

boolean

param DryRun

Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation . Otherwise, it is UnauthorizedOperation .

type ImageLocation

string

param ImageLocation

The full path to your AMI manifest in Amazon S3 storage.

type Name

string

param Name

[REQUIRED]

A name for your AMI.

Constraints: 3-128 alphanumeric characters, parentheses (()), square brackets ([]), spaces ( ), periods (.), slashes (/), dashes (-), single quotes ('), at-signs (@), or underscores(_)

type Description

string

param Description

A description for your AMI.

type Architecture

string

param Architecture

The architecture of the AMI.

Default: For Amazon EBS-backed AMIs, i386 . For instance store-backed AMIs, the architecture specified in the manifest file.

type KernelId

string

param KernelId

The ID of the kernel.

type RamdiskId

string

param RamdiskId

The ID of the RAM disk.

type RootDeviceName

string

param RootDeviceName

The name of the root device (for example, /dev/sda1 , or /dev/xvda ).

type BlockDeviceMappings

list

param BlockDeviceMappings

One or more block device mapping entries.

  • (dict) --

    Describes a block device mapping.

    • VirtualName (string) --

      The virtual device name ( ephemeral N). Instance store volumes are numbered starting from 0. An instance type with 2 available instance store volumes can specify mappings for ephemeral0 and ephemeral1 .The number of available instance store volumes depends on the instance type. After you connect to the instance, you must mount the volume.

      Constraints: For M3 instances, you must specify instance store volumes in the block device mapping for the instance. When you launch an M3 instance, we ignore any instance store volumes specified in the block device mapping for the AMI.

    • DeviceName (string) --

      The device name exposed to the instance (for example, /dev/sdh or xvdh ).

    • Ebs (dict) --

      Parameters used to automatically set up EBS volumes when the instance is launched.

      • SnapshotId (string) --

        The ID of the snapshot.

      • VolumeSize (integer) --

        The size of the volume, in GiB.

        Constraints: 1-16384 for General Purpose SSD ( gp2 ), 4-16384 for Provisioned IOPS SSD ( io1 ), 500-16384 for Throughput Optimized HDD ( st1 ), 500-16384 for Cold HDD ( sc1 ), and 1-1024 for Magnetic ( standard ) volumes. If you specify a snapshot, the volume size must be equal to or larger than the snapshot size.

        Default: If you're creating the volume from a snapshot and don't specify a volume size, the default is the snapshot size.

      • DeleteOnTermination (boolean) --

        Indicates whether the EBS volume is deleted on instance termination.

      • VolumeType (string) --

        The volume type: gp2 , io1 , st1 , sc1 , or standard .

        Default: standard

      • Iops (integer) --

        The number of I/O operations per second (IOPS) that the volume supports. For io1 , this represents the number of IOPS that are provisioned for the volume. For gp2 , this represents the baseline performance of the volume and the rate at which the volume accumulates I/O credits for bursting. For more information about General Purpose SSD baseline performance, I/O credits, and bursting, see Amazon EBS Volume Types in the Amazon Elastic Compute Cloud User Guide .

        Constraint: Range is 100-20000 IOPS for io1 volumes and 100-10000 IOPS for gp2 volumes.

        Condition: This parameter is required for requests to create io1 volumes; it is not used in requests to create gp2 , st1 , sc1 , or standard volumes.

      • Encrypted (boolean) --

        Indicates whether the EBS volume is encrypted. Encrypted Amazon EBS volumes may only be attached to instances that support Amazon EBS encryption.

    • NoDevice (string) --

      Suppresses the specified device included in the block device mapping of the AMI.

type VirtualizationType

string

param VirtualizationType

The type of virtualization.

Default: paravirtual

type SriovNetSupport

string

param SriovNetSupport

Set to simple to enable enhanced networking with the Intel 82599 Virtual Function interface for the AMI and any instances that you launch from the AMI.

There is no way to disable sriovNetSupport at this time.

This option is supported only for HVM AMIs. Specifying this option with a PV AMI can make instances launched from the AMI unreachable.

type EnaSupport

boolean

param EnaSupport

Set to true to enable enhanced networking with ENA for the AMI and any instances that you launch from the AMI.

This option is supported only for HVM AMIs. Specifying this option with a PV AMI can make instances launched from the AMI unreachable.

rtype

dict

returns

Response Syntax

{
    'ImageId': 'string'
}

Response Structure

  • (dict) --

    Contains the output of RegisterImage.

    • ImageId (string) --

      The ID of the newly registered AMI.

ResetInstanceAttribute (updated) Link ¶
Changes (request)
{'Attribute': {'enaSupport'}}

Resets an attribute of an instance to its default value. To reset the kernel or ramdisk , the instance must be in a stopped state. To reset the sourceDestCheck , the instance can be either running or stopped.

The sourceDestCheck attribute controls whether source/destination checking is enabled. The default value is true , which means checking is enabled. This value must be false for a NAT instance to perform NAT. For more information, see NAT Instances in the Amazon Virtual Private Cloud User Guide .

Request Syntax

client.reset_instance_attribute(
    DryRun=True|False,
    InstanceId='string',
    Attribute='instanceType'|'kernel'|'ramdisk'|'userData'|'disableApiTermination'|'instanceInitiatedShutdownBehavior'|'rootDeviceName'|'blockDeviceMapping'|'productCodes'|'sourceDestCheck'|'groupSet'|'ebsOptimized'|'sriovNetSupport'|'enaSupport'
)
type DryRun

boolean

param DryRun

Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation . Otherwise, it is UnauthorizedOperation .

type InstanceId

string

param InstanceId

[REQUIRED]

The ID of the instance.

type Attribute

string

param Attribute

[REQUIRED]

The attribute to reset.

Warning

You can only reset the following attributes: kernel | ramdisk | sourceDestCheck . To change an instance attribute, use ModifyInstanceAttribute.

returns

None

RunInstances (updated) Link ¶
Changes (response)
{'Instances': {'EnaSupport': 'boolean'}}

Launches the specified number of instances using an AMI for which you have permissions.

When you launch an instance, it enters the pending state. After the instance is ready for you, it enters the running state. To check the state of your instance, call DescribeInstances.

To ensure faster instance launches, break up large requests into smaller batches. For example, create five separate launch requests for 100 instances each instead of one launch request for 500 instances.

To tag your instance, ensure that it is running as CreateTags requires a resource ID. For more information about tagging, see Tagging Your Amazon EC2 Resources.

If you don't specify a security group when launching an instance, Amazon EC2 uses the default security group. For more information, see Security Groups in the Amazon Elastic Compute Cloud User Guide .

[EC2-VPC only accounts] If you don't specify a subnet in the request, we choose a default subnet from your default VPC for you.

[EC2-Classic accounts] If you're launching into EC2-Classic and you don't specify an Availability Zone, we choose one for you.

Linux instances have access to the public key of the key pair at boot. You can use this key to provide secure access to the instance. Amazon EC2 public images use this feature to provide secure access without passwords. For more information, see Key Pairs in the Amazon Elastic Compute Cloud User Guide .

You can provide optional user data when launching an instance. For more information, see Instance Metadata in the Amazon Elastic Compute Cloud User Guide .

If any of the AMIs have a product code attached for which the user has not subscribed, RunInstances fails.

Some instance types can only be launched into a VPC. If you do not have a default VPC, or if you do not specify a subnet ID in the request, RunInstances fails. For more information, see Instance Types Available Only in a VPC.

For more information about troubleshooting, see What To Do If An Instance Immediately Terminates, and Troubleshooting Connecting to Your Instance in the Amazon Elastic Compute Cloud User Guide .

Request Syntax

client.run_instances(
    DryRun=True|False,
    ImageId='string',
    MinCount=123,
    MaxCount=123,
    KeyName='string',
    SecurityGroups=[
        'string',
    ],
    SecurityGroupIds=[
        'string',
    ],
    UserData='string',
    InstanceType='t1.micro'|'t2.nano'|'t2.micro'|'t2.small'|'t2.medium'|'t2.large'|'m1.small'|'m1.medium'|'m1.large'|'m1.xlarge'|'m3.medium'|'m3.large'|'m3.xlarge'|'m3.2xlarge'|'m4.large'|'m4.xlarge'|'m4.2xlarge'|'m4.4xlarge'|'m4.10xlarge'|'m2.xlarge'|'m2.2xlarge'|'m2.4xlarge'|'cr1.8xlarge'|'r3.large'|'r3.xlarge'|'r3.2xlarge'|'r3.4xlarge'|'r3.8xlarge'|'x1.4xlarge'|'x1.8xlarge'|'x1.16xlarge'|'x1.32xlarge'|'i2.xlarge'|'i2.2xlarge'|'i2.4xlarge'|'i2.8xlarge'|'hi1.4xlarge'|'hs1.8xlarge'|'c1.medium'|'c1.xlarge'|'c3.large'|'c3.xlarge'|'c3.2xlarge'|'c3.4xlarge'|'c3.8xlarge'|'c4.large'|'c4.xlarge'|'c4.2xlarge'|'c4.4xlarge'|'c4.8xlarge'|'cc1.4xlarge'|'cc2.8xlarge'|'g2.2xlarge'|'g2.8xlarge'|'cg1.4xlarge'|'d2.xlarge'|'d2.2xlarge'|'d2.4xlarge'|'d2.8xlarge',
    Placement={
        'AvailabilityZone': 'string',
        'GroupName': 'string',
        'Tenancy': 'default'|'dedicated'|'host',
        'HostId': 'string',
        'Affinity': 'string'
    },
    KernelId='string',
    RamdiskId='string',
    BlockDeviceMappings=[
        {
            'VirtualName': 'string',
            'DeviceName': 'string',
            'Ebs': {
                'SnapshotId': 'string',
                'VolumeSize': 123,
                'DeleteOnTermination': True|False,
                'VolumeType': 'standard'|'io1'|'gp2'|'sc1'|'st1',
                'Iops': 123,
                'Encrypted': True|False
            },
            'NoDevice': 'string'
        },
    ],
    Monitoring={
        'Enabled': True|False
    },
    SubnetId='string',
    DisableApiTermination=True|False,
    InstanceInitiatedShutdownBehavior='stop'|'terminate',
    PrivateIpAddress='string',
    ClientToken='string',
    AdditionalInfo='string',
    NetworkInterfaces=[
        {
            'NetworkInterfaceId': 'string',
            'DeviceIndex': 123,
            'SubnetId': 'string',
            'Description': 'string',
            'PrivateIpAddress': 'string',
            'Groups': [
                'string',
            ],
            'DeleteOnTermination': True|False,
            'PrivateIpAddresses': [
                {
                    'PrivateIpAddress': 'string',
                    'Primary': True|False
                },
            ],
            'SecondaryPrivateIpAddressCount': 123,
            'AssociatePublicIpAddress': True|False
        },
    ],
    IamInstanceProfile={
        'Arn': 'string',
        'Name': 'string'
    },
    EbsOptimized=True|False
)
type DryRun

boolean

param DryRun

Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation . Otherwise, it is UnauthorizedOperation .

type ImageId

string

param ImageId

[REQUIRED]

The ID of the AMI, which you can get by calling DescribeImages.

type MinCount

integer

param MinCount

[REQUIRED]

The minimum number of instances to launch. If you specify a minimum that is more instances than Amazon EC2 can launch in the target Availability Zone, Amazon EC2 launches no instances.

Constraints: Between 1 and the maximum number you're allowed for the specified instance type. For more information about the default limits, and how to request an increase, see How many instances can I run in Amazon EC2 in the Amazon EC2 General FAQ.

type MaxCount

integer

param MaxCount

[REQUIRED]

The maximum number of instances to launch. If you specify more instances than Amazon EC2 can launch in the target Availability Zone, Amazon EC2 launches the largest possible number of instances above MinCount .

Constraints: Between 1 and the maximum number you're allowed for the specified instance type. For more information about the default limits, and how to request an increase, see How many instances can I run in Amazon EC2 in the Amazon EC2 FAQ.

type KeyName

string

param KeyName

The name of the key pair. You can create a key pair using CreateKeyPair or ImportKeyPair.

Warning

If you do not specify a key pair, you can't connect to the instance unless you choose an AMI that is configured to allow users another way to log in.

type SecurityGroups

list

param SecurityGroups

[EC2-Classic, default VPC] One or more security group names. For a nondefault VPC, you must use security group IDs instead.

Default: Amazon EC2 uses the default security group.

  • (string) --

type SecurityGroupIds

list

param SecurityGroupIds

One or more security group IDs. You can create a security group using CreateSecurityGroup.

Default: Amazon EC2 uses the default security group.

  • (string) --

type UserData

string

param UserData

The user data to make available to the instance. For more information, see Running Commands on Your Linux Instance at Launch (Linux) and Adding User Data (Windows). If you are using an AWS SDK or command line tool, Base64-encoding is performed for you, and you can load the text from a file. Otherwise, you must provide Base64-encoded text.

type InstanceType

string

param InstanceType

The instance type. For more information, see Instance Types in the Amazon Elastic Compute Cloud User Guide .

Default: m1.small

type Placement

dict

param Placement

The placement for the instance.

  • AvailabilityZone (string) --

    The Availability Zone of the instance.

  • GroupName (string) --

    The name of the placement group the instance is in (for cluster compute instances).

  • Tenancy (string) --

    The tenancy of the instance (if the instance is running in a VPC). An instance with a tenancy of dedicated runs on single-tenant hardware. The host tenancy is not supported for the ImportInstance command.

  • HostId (string) --

    The ID of the Dedicted host on which the instance resides. This parameter is not support for the ImportInstance command.

  • Affinity (string) --

    The affinity setting for the instance on the Dedicated host. This parameter is not supported for the ImportInstance command.

type KernelId

string

param KernelId

The ID of the kernel.

Warning

We recommend that you use PV-GRUB instead of kernels and RAM disks. For more information, see PV-GRUB in the Amazon Elastic Compute Cloud User Guide .

type RamdiskId

string

param RamdiskId

The ID of the RAM disk.

Warning

We recommend that you use PV-GRUB instead of kernels and RAM disks. For more information, see PV-GRUB in the Amazon Elastic Compute Cloud User Guide .

type BlockDeviceMappings

list

param BlockDeviceMappings

The block device mapping.

  • (dict) --

    Describes a block device mapping.

    • VirtualName (string) --

      The virtual device name ( ephemeral N). Instance store volumes are numbered starting from 0. An instance type with 2 available instance store volumes can specify mappings for ephemeral0 and ephemeral1 .The number of available instance store volumes depends on the instance type. After you connect to the instance, you must mount the volume.

      Constraints: For M3 instances, you must specify instance store volumes in the block device mapping for the instance. When you launch an M3 instance, we ignore any instance store volumes specified in the block device mapping for the AMI.

    • DeviceName (string) --

      The device name exposed to the instance (for example, /dev/sdh or xvdh ).

    • Ebs (dict) --

      Parameters used to automatically set up EBS volumes when the instance is launched.

      • SnapshotId (string) --

        The ID of the snapshot.

      • VolumeSize (integer) --

        The size of the volume, in GiB.

        Constraints: 1-16384 for General Purpose SSD ( gp2 ), 4-16384 for Provisioned IOPS SSD ( io1 ), 500-16384 for Throughput Optimized HDD ( st1 ), 500-16384 for Cold HDD ( sc1 ), and 1-1024 for Magnetic ( standard ) volumes. If you specify a snapshot, the volume size must be equal to or larger than the snapshot size.

        Default: If you're creating the volume from a snapshot and don't specify a volume size, the default is the snapshot size.

      • DeleteOnTermination (boolean) --

        Indicates whether the EBS volume is deleted on instance termination.

      • VolumeType (string) --

        The volume type: gp2 , io1 , st1 , sc1 , or standard .

        Default: standard

      • Iops (integer) --

        The number of I/O operations per second (IOPS) that the volume supports. For io1 , this represents the number of IOPS that are provisioned for the volume. For gp2 , this represents the baseline performance of the volume and the rate at which the volume accumulates I/O credits for bursting. For more information about General Purpose SSD baseline performance, I/O credits, and bursting, see Amazon EBS Volume Types in the Amazon Elastic Compute Cloud User Guide .

        Constraint: Range is 100-20000 IOPS for io1 volumes and 100-10000 IOPS for gp2 volumes.

        Condition: This parameter is required for requests to create io1 volumes; it is not used in requests to create gp2 , st1 , sc1 , or standard volumes.

      • Encrypted (boolean) --

        Indicates whether the EBS volume is encrypted. Encrypted Amazon EBS volumes may only be attached to instances that support Amazon EBS encryption.

    • NoDevice (string) --

      Suppresses the specified device included in the block device mapping of the AMI.

type Monitoring

dict

param Monitoring

The monitoring for the instance.

  • Enabled (boolean) -- [REQUIRED]

    Indicates whether monitoring is enabled for the instance.

type SubnetId

string

param SubnetId

[EC2-VPC] The ID of the subnet to launch the instance into.

type DisableApiTermination

boolean

param DisableApiTermination

If you set this parameter to true , you can't terminate the instance using the Amazon EC2 console, CLI, or API; otherwise, you can. If you set this parameter to true and then later want to be able to terminate the instance, you must first change the value of the disableApiTermination attribute to false using ModifyInstanceAttribute. Alternatively, if you set InstanceInitiatedShutdownBehavior to terminate , you can terminate the instance by running the shutdown command from the instance.

Default: false

type InstanceInitiatedShutdownBehavior

string

param InstanceInitiatedShutdownBehavior

Indicates whether an instance stops or terminates when you initiate shutdown from the instance (using the operating system command for system shutdown).

Default: stop

type PrivateIpAddress

string

param PrivateIpAddress

[EC2-VPC] The primary IP address. You must specify a value from the IP address range of the subnet.

Only one private IP address can be designated as primary. Therefore, you can't specify this parameter if PrivateIpAddresses.n.Primary is set to true and PrivateIpAddresses.n.PrivateIpAddress is set to an IP address.

Default: We select an IP address from the IP address range of the subnet.

type ClientToken

string

param ClientToken

Unique, case-sensitive identifier you provide to ensure the idempotency of the request. For more information, see Ensuring Idempotency.

Constraints: Maximum 64 ASCII characters

type AdditionalInfo

string

param AdditionalInfo

Reserved.

type NetworkInterfaces

list

param NetworkInterfaces

One or more network interfaces.

  • (dict) --

    Describes a network interface.

    • NetworkInterfaceId (string) --

      The ID of the network interface.

    • DeviceIndex (integer) --

      The index of the device on the instance for the network interface attachment. If you are specifying a network interface in a RunInstances request, you must provide the device index.

    • SubnetId (string) --

      The ID of the subnet associated with the network string. Applies only if creating a network interface when launching an instance.

    • Description (string) --

      The description of the network interface. Applies only if creating a network interface when launching an instance.

    • PrivateIpAddress (string) --

      The private IP address of the network interface. Applies only if creating a network interface when launching an instance.

    • Groups (list) --

      The IDs of the security groups for the network interface. Applies only if creating a network interface when launching an instance.

      • (string) --

    • DeleteOnTermination (boolean) --

      If set to true , the interface is deleted when the instance is terminated. You can specify true only if creating a new network interface when launching an instance.

    • PrivateIpAddresses (list) --

      One or more private IP addresses to assign to the network interface. Only one private IP address can be designated as primary.

      • (dict) --

        Describes a secondary private IP address for a network interface.

        • PrivateIpAddress (string) -- [REQUIRED]

          The private IP addresses.

        • Primary (boolean) --

          Indicates whether the private IP address is the primary private IP address. Only one IP address can be designated as primary.

    • SecondaryPrivateIpAddressCount (integer) --

      The number of secondary private IP addresses. You can't specify this option and specify more than one private IP address using the private IP addresses option.

    • AssociatePublicIpAddress (boolean) --

      Indicates whether to assign a public IP address to an instance you launch in a VPC. The public IP address can only be assigned to a network interface for eth0, and can only be assigned to a new network interface, not an existing one. You cannot specify more than one network interface in the request. If launching into a default subnet, the default value is true .

type IamInstanceProfile

dict

param IamInstanceProfile

The IAM instance profile.

  • Arn (string) --

    The Amazon Resource Name (ARN) of the instance profile.

  • Name (string) --

    The name of the instance profile.

type EbsOptimized

boolean

param EbsOptimized

Indicates whether the instance is optimized for EBS I/O. This optimization provides dedicated throughput to Amazon EBS and an optimized configuration stack to provide optimal EBS I/O performance. This optimization isn't available with all instance types. Additional usage charges apply when using an EBS-optimized instance.

Default: false

rtype

dict

returns

Response Syntax

{
    'ReservationId': 'string',
    'OwnerId': 'string',
    'RequesterId': 'string',
    'Groups': [
        {
            'GroupName': 'string',
            'GroupId': 'string'
        },
    ],
    'Instances': [
        {
            'InstanceId': 'string',
            'ImageId': 'string',
            'State': {
                'Code': 123,
                'Name': 'pending'|'running'|'shutting-down'|'terminated'|'stopping'|'stopped'
            },
            'PrivateDnsName': 'string',
            'PublicDnsName': 'string',
            'StateTransitionReason': 'string',
            'KeyName': 'string',
            'AmiLaunchIndex': 123,
            'ProductCodes': [
                {
                    'ProductCodeId': 'string',
                    'ProductCodeType': 'devpay'|'marketplace'
                },
            ],
            'InstanceType': 't1.micro'|'t2.nano'|'t2.micro'|'t2.small'|'t2.medium'|'t2.large'|'m1.small'|'m1.medium'|'m1.large'|'m1.xlarge'|'m3.medium'|'m3.large'|'m3.xlarge'|'m3.2xlarge'|'m4.large'|'m4.xlarge'|'m4.2xlarge'|'m4.4xlarge'|'m4.10xlarge'|'m2.xlarge'|'m2.2xlarge'|'m2.4xlarge'|'cr1.8xlarge'|'r3.large'|'r3.xlarge'|'r3.2xlarge'|'r3.4xlarge'|'r3.8xlarge'|'x1.4xlarge'|'x1.8xlarge'|'x1.16xlarge'|'x1.32xlarge'|'i2.xlarge'|'i2.2xlarge'|'i2.4xlarge'|'i2.8xlarge'|'hi1.4xlarge'|'hs1.8xlarge'|'c1.medium'|'c1.xlarge'|'c3.large'|'c3.xlarge'|'c3.2xlarge'|'c3.4xlarge'|'c3.8xlarge'|'c4.large'|'c4.xlarge'|'c4.2xlarge'|'c4.4xlarge'|'c4.8xlarge'|'cc1.4xlarge'|'cc2.8xlarge'|'g2.2xlarge'|'g2.8xlarge'|'cg1.4xlarge'|'d2.xlarge'|'d2.2xlarge'|'d2.4xlarge'|'d2.8xlarge',
            'LaunchTime': datetime(2015, 1, 1),
            'Placement': {
                'AvailabilityZone': 'string',
                'GroupName': 'string',
                'Tenancy': 'default'|'dedicated'|'host',
                'HostId': 'string',
                'Affinity': 'string'
            },
            'KernelId': 'string',
            'RamdiskId': 'string',
            'Platform': 'Windows',
            'Monitoring': {
                'State': 'disabled'|'disabling'|'enabled'|'pending'
            },
            'SubnetId': 'string',
            'VpcId': 'string',
            'PrivateIpAddress': 'string',
            'PublicIpAddress': 'string',
            'StateReason': {
                'Code': 'string',
                'Message': 'string'
            },
            'Architecture': 'i386'|'x86_64',
            'RootDeviceType': 'ebs'|'instance-store',
            'RootDeviceName': 'string',
            'BlockDeviceMappings': [
                {
                    'DeviceName': 'string',
                    'Ebs': {
                        'VolumeId': 'string',
                        'Status': 'attaching'|'attached'|'detaching'|'detached',
                        'AttachTime': datetime(2015, 1, 1),
                        'DeleteOnTermination': True|False
                    }
                },
            ],
            'VirtualizationType': 'hvm'|'paravirtual',
            'InstanceLifecycle': 'spot'|'scheduled',
            'SpotInstanceRequestId': 'string',
            'ClientToken': 'string',
            'Tags': [
                {
                    'Key': 'string',
                    'Value': 'string'
                },
            ],
            'SecurityGroups': [
                {
                    'GroupName': 'string',
                    'GroupId': 'string'
                },
            ],
            'SourceDestCheck': True|False,
            'Hypervisor': 'ovm'|'xen',
            'NetworkInterfaces': [
                {
                    'NetworkInterfaceId': 'string',
                    'SubnetId': 'string',
                    'VpcId': 'string',
                    'Description': 'string',
                    'OwnerId': 'string',
                    'Status': 'available'|'attaching'|'in-use'|'detaching',
                    'MacAddress': 'string',
                    'PrivateIpAddress': 'string',
                    'PrivateDnsName': 'string',
                    'SourceDestCheck': True|False,
                    'Groups': [
                        {
                            'GroupName': 'string',
                            'GroupId': 'string'
                        },
                    ],
                    'Attachment': {
                        'AttachmentId': 'string',
                        'DeviceIndex': 123,
                        'Status': 'attaching'|'attached'|'detaching'|'detached',
                        'AttachTime': datetime(2015, 1, 1),
                        'DeleteOnTermination': True|False
                    },
                    'Association': {
                        'PublicIp': 'string',
                        'PublicDnsName': 'string',
                        'IpOwnerId': 'string'
                    },
                    'PrivateIpAddresses': [
                        {
                            'PrivateIpAddress': 'string',
                            'PrivateDnsName': 'string',
                            'Primary': True|False,
                            'Association': {
                                'PublicIp': 'string',
                                'PublicDnsName': 'string',
                                'IpOwnerId': 'string'
                            }
                        },
                    ]
                },
            ],
            'IamInstanceProfile': {
                'Arn': 'string',
                'Id': 'string'
            },
            'EbsOptimized': True|False,
            'SriovNetSupport': 'string',
            'EnaSupport': True|False
        },
    ]
}

Response Structure

  • (dict) --

    Describes a reservation.

    • ReservationId (string) --

      The ID of the reservation.

    • OwnerId (string) --

      The ID of the AWS account that owns the reservation.

    • RequesterId (string) --

      The ID of the requester that launched the instances on your behalf (for example, AWS Management Console or Auto Scaling).

    • Groups (list) --

      [EC2-Classic only] One or more security groups.

      • (dict) --

        Describes a security group.

        • GroupName (string) --

          The name of the security group.

        • GroupId (string) --

          The ID of the security group.

    • Instances (list) --

      One or more instances.

      • (dict) --

        Describes an instance.

        • InstanceId (string) --

          The ID of the instance.

        • ImageId (string) --

          The ID of the AMI used to launch the instance.

        • State (dict) --

          The current state of the instance.

          • Code (integer) --

            The low byte represents the state. The high byte is an opaque internal value and should be ignored.

            • 0 : pending

            • 16 : running

            • 32 : shutting-down

            • 48 : terminated

            • 64 : stopping

            • 80 : stopped

          • Name (string) --

            The current state of the instance.

        • PrivateDnsName (string) --

          The private DNS name assigned to the instance. This DNS name can only be used inside the Amazon EC2 network. This name is not available until the instance enters the running state. For EC2-VPC, this name is only available if you've enabled DNS hostnames for your VPC.

        • PublicDnsName (string) --

          The public DNS name assigned to the instance. This name is not available until the instance enters the running state. For EC2-VPC, this name is only available if you've enabled DNS hostnames for your VPC.

        • StateTransitionReason (string) --

          The reason for the most recent state transition. This might be an empty string.

        • KeyName (string) --

          The name of the key pair, if this instance was launched with an associated key pair.

        • AmiLaunchIndex (integer) --

          The AMI launch index, which can be used to find this instance in the launch group.

        • ProductCodes (list) --

          The product codes attached to this instance, if applicable.

          • (dict) --

            Describes a product code.

            • ProductCodeId (string) --

              The product code.

            • ProductCodeType (string) --

              The type of product code.

        • InstanceType (string) --

          The instance type.

        • LaunchTime (datetime) --

          The time the instance was launched.

        • Placement (dict) --

          The location where the instance launched, if applicable.

          • AvailabilityZone (string) --

            The Availability Zone of the instance.

          • GroupName (string) --

            The name of the placement group the instance is in (for cluster compute instances).

          • Tenancy (string) --

            The tenancy of the instance (if the instance is running in a VPC). An instance with a tenancy of dedicated runs on single-tenant hardware. The host tenancy is not supported for the ImportInstance command.

          • HostId (string) --

            The ID of the Dedicted host on which the instance resides. This parameter is not support for the ImportInstance command.

          • Affinity (string) --

            The affinity setting for the instance on the Dedicated host. This parameter is not supported for the ImportInstance command.

        • KernelId (string) --

          The kernel associated with this instance, if applicable.

        • RamdiskId (string) --

          The RAM disk associated with this instance, if applicable.

        • Platform (string) --

          The value is Windows for Windows instances; otherwise blank.

        • Monitoring (dict) --

          The monitoring information for the instance.

          • State (string) --

            Indicates whether monitoring is enabled for the instance.

        • SubnetId (string) --

          [EC2-VPC] The ID of the subnet in which the instance is running.

        • VpcId (string) --

          [EC2-VPC] The ID of the VPC in which the instance is running.

        • PrivateIpAddress (string) --

          The private IP address assigned to the instance.

        • PublicIpAddress (string) --

          The public IP address assigned to the instance, if applicable.

        • StateReason (dict) --

          The reason for the most recent state transition.

          • Code (string) --

            The reason code for the state change.

          • Message (string) --

            The message for the state change.

            • Server.SpotInstanceTermination : A Spot instance was terminated due to an increase in the market price.

            • Server.InternalError : An internal error occurred during instance launch, resulting in termination.

            • Server.InsufficientInstanceCapacity : There was insufficient instance capacity to satisfy the launch request.

            • Client.InternalError : A client error caused the instance to terminate on launch.

            • Client.InstanceInitiatedShutdown : The instance was shut down using the shutdown -h command from the instance.

            • Client.UserInitiatedShutdown : The instance was shut down using the Amazon EC2 API.

            • Client.VolumeLimitExceeded : The limit on the number of EBS volumes or total storage was exceeded. Decrease usage or request an increase in your limits.

            • Client.InvalidSnapshot.NotFound : The specified snapshot was not found.

        • Architecture (string) --

          The architecture of the image.

        • RootDeviceType (string) --

          The root device type used by the AMI. The AMI can use an EBS volume or an instance store volume.

        • RootDeviceName (string) --

          The root device name (for example, /dev/sda1 or /dev/xvda ).

        • BlockDeviceMappings (list) --

          Any block device mapping entries for the instance.

          • (dict) --

            Describes a block device mapping.

            • DeviceName (string) --

              The device name exposed to the instance (for example, /dev/sdh or xvdh ).

            • Ebs (dict) --

              Parameters used to automatically set up EBS volumes when the instance is launched.

              • VolumeId (string) --

                The ID of the EBS volume.

              • Status (string) --

                The attachment state.

              • AttachTime (datetime) --

                The time stamp when the attachment initiated.

              • DeleteOnTermination (boolean) --

                Indicates whether the volume is deleted on instance termination.

        • VirtualizationType (string) --

          The virtualization type of the instance.

        • InstanceLifecycle (string) --

          Indicates whether this is a Spot instance or a Scheduled Instance.

        • SpotInstanceRequestId (string) --

          If the request is a Spot instance request, the ID of the request.

        • ClientToken (string) --

          The idempotency token you provided when you launched the instance, if applicable.

        • Tags (list) --

          Any tags assigned to the instance.

          • (dict) --

            Describes a tag.

            • Key (string) --

              The key of the tag.

              Constraints: Tag keys are case-sensitive and accept a maximum of 127 Unicode characters. May not begin with aws:

            • Value (string) --

              The value of the tag.

              Constraints: Tag values are case-sensitive and accept a maximum of 255 Unicode characters.

        • SecurityGroups (list) --

          One or more security groups for the instance.

          • (dict) --

            Describes a security group.

            • GroupName (string) --

              The name of the security group.

            • GroupId (string) --

              The ID of the security group.

        • SourceDestCheck (boolean) --

          Specifies whether to enable an instance launched in a VPC to perform NAT. This controls whether source/destination checking is enabled on the instance. A value of true means checking is enabled, and false means checking is disabled. The value must be false for the instance to perform NAT. For more information, see NAT Instances in the Amazon Virtual Private Cloud User Guide .

        • Hypervisor (string) --

          The hypervisor type of the instance.

        • NetworkInterfaces (list) --

          [EC2-VPC] One or more network interfaces for the instance.

          • (dict) --

            Describes a network interface.

            • NetworkInterfaceId (string) --

              The ID of the network interface.

            • SubnetId (string) --

              The ID of the subnet.

            • VpcId (string) --

              The ID of the VPC.

            • Description (string) --

              The description.

            • OwnerId (string) --

              The ID of the AWS account that created the network interface.

            • Status (string) --

              The status of the network interface.

            • MacAddress (string) --

              The MAC address.

            • PrivateIpAddress (string) --

              The IP address of the network interface within the subnet.

            • PrivateDnsName (string) --

              The private DNS name.

            • SourceDestCheck (boolean) --

              Indicates whether to validate network traffic to or from this network interface.

            • Groups (list) --

              One or more security groups.

              • (dict) --

                Describes a security group.

                • GroupName (string) --

                  The name of the security group.

                • GroupId (string) --

                  The ID of the security group.

            • Attachment (dict) --

              The network interface attachment.

              • AttachmentId (string) --

                The ID of the network interface attachment.

              • DeviceIndex (integer) --

                The index of the device on the instance for the network interface attachment.

              • Status (string) --

                The attachment state.

              • AttachTime (datetime) --

                The time stamp when the attachment initiated.

              • DeleteOnTermination (boolean) --

                Indicates whether the network interface is deleted when the instance is terminated.

            • Association (dict) --

              The association information for an Elastic IP associated with the network interface.

              • PublicIp (string) --

                The public IP address or Elastic IP address bound to the network interface.

              • PublicDnsName (string) --

                The public DNS name.

              • IpOwnerId (string) --

                The ID of the owner of the Elastic IP address.

            • PrivateIpAddresses (list) --

              The private IP addresses associated with the network interface.

              • (dict) --

                Describes a private IP address.

                • PrivateIpAddress (string) --

                  The private IP address of the network interface.

                • PrivateDnsName (string) --

                  The private DNS name.

                • Primary (boolean) --

                  Indicates whether this IP address is the primary private IP address of the network interface.

                • Association (dict) --

                  The association information for an Elastic IP address for the network interface.

                  • PublicIp (string) --

                    The public IP address or Elastic IP address bound to the network interface.

                  • PublicDnsName (string) --

                    The public DNS name.

                  • IpOwnerId (string) --

                    The ID of the owner of the Elastic IP address.

        • IamInstanceProfile (dict) --

          The IAM instance profile associated with the instance, if applicable.

          • Arn (string) --

            The Amazon Resource Name (ARN) of the instance profile.

          • Id (string) --

            The ID of the instance profile.

        • EbsOptimized (boolean) --

          Indicates whether the instance is optimized for EBS I/O. This optimization provides dedicated throughput to Amazon EBS and an optimized configuration stack to provide optimal I/O performance. This optimization isn't available with all instance types. Additional usage charges apply when using an EBS Optimized instance.

        • SriovNetSupport (string) --

          Specifies whether enhanced networking with the Intel 82599 Virtual Function interface is enabled.

        • EnaSupport (boolean) --

          Specifies whether enhanced networking with ENA is enabled.