Amazon Elastic Compute Cloud

2017/11/16 - Amazon Elastic Compute Cloud - 12 updated api methods

Changes  You are now able to create and launch EC2 x1e smaller instance sizes

DescribeInstances (updated) Link ¶
Changes (response)
{'Reservations': {'Instances': {'InstanceType': {'x1e.16xlarge',
                                                 'x1e.2xlarge',
                                                 'x1e.4xlarge',
                                                 'x1e.8xlarge',
                                                 'x1e.xlarge'}}}}

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.

See also: AWS API Documentation

Request Syntax

client.describe_instances(
    Filters=[
        {
            'Name': 'string',
            'Values': [
                'string',
            ]
        },
    ],
    InstanceIds=[
        'string',
    ],
    DryRun=True|False,
    MaxResults=123,
    NextToken='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 specified in the block device mapping (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 IPv4 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 detailed monitoring is enabled ( disabled | enabled ).

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

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

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

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

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

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

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

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

  • 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.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.availability-zone - The Availability Zone for the network interface.

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

  • 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.ipv6-addresses.ipv6-address - The IPv6 address associated with the network interface.

  • network-interface.mac-address - The MAC address of 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.private-dns-name - The private DNS name of 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.source-dest-check - Whether the network interface performs source/destination checking. A value of true means that checking is enabled, and false means that checking is disabled. The value must be false for the network interface to perform network address translation (NAT) in your VPC.

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

  • 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 IPv4 DNS name of the instance.

  • private-ip-address - The private IPv4 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 get one reservation ID. If you launch ten instances using the same launch request, you also get one reservation ID.

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

  • root-device-type - The type of the root device volume ( 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 that 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. Specify the key of the tag in the filter name and the value of the tag in the filter value. For example, for the tag Purpose=X, specify tag:Purpose for the filter name and X for the filter value.

  • 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 the tag's key). 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.

  • (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 InstanceIds

list

param InstanceIds

One or more instance IDs.

Default: Describes all your instances.

  • (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 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.

type NextToken

string

param NextToken

The token to request the next page of results.

rtype

dict

returns

Response Syntax

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

Response Structure

  • (dict) --

    Contains the output of DescribeInstances.

    • Reservations (list) --

      Zero or more reservations.

      • (dict) --

        Describes a reservation.

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

            • AmiLaunchIndex (integer) --

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

            • ImageId (string) --

              The ID of the AMI used to launch the instance.

            • InstanceId (string) --

              The ID of the instance.

            • InstanceType (string) --

              The instance type.

            • KernelId (string) --

              The kernel associated with this instance, if applicable.

            • KeyName (string) --

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

            • LaunchTime (datetime) --

              The time the instance was launched.

            • Monitoring (dict) --

              The monitoring for the instance.

              • State (string) --

                Indicates whether detailed monitoring is enabled. Otherwise, basic monitoring is enabled.

            • Placement (dict) --

              The location where the instance launched, if applicable.

              • AvailabilityZone (string) --

                The Availability Zone of the instance.

              • Affinity (string) --

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

              • GroupName (string) --

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

              • HostId (string) --

                The ID of the Dedicated Host on which the instance resides. This parameter is not supported for the ImportInstance command.

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

              • SpreadDomain (string) --

                Reserved for future use.

            • Platform (string) --

              The value is Windows for Windows instances; otherwise blank.

            • PrivateDnsName (string) --

              (IPv4 only) The private DNS hostname name assigned to the instance. This DNS hostname can only be used inside the Amazon EC2 network. This name is not available until the instance enters the running state.

              [EC2-VPC] The Amazon-provided DNS server resolves Amazon-provided private DNS hostnames if you've enabled DNS resolution and DNS hostnames in your VPC. If you are not using the Amazon-provided DNS server in your VPC, your custom domain name servers must resolve the hostname as appropriate.

            • PrivateIpAddress (string) --

              The private IPv4 address assigned to the instance.

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

            • PublicDnsName (string) --

              (IPv4 only) 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.

            • PublicIpAddress (string) --

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

            • RamdiskId (string) --

              The RAM disk associated with this instance, if applicable.

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

            • StateTransitionReason (string) --

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

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

            • Architecture (string) --

              The architecture of the image.

            • BlockDeviceMappings (list) --

              Any block device mapping entries for the instance.

              • (dict) --

                Describes a block device mapping.

                • DeviceName (string) --

                  The device name (for example, /dev/sdh or xvdh ).

                • Ebs (dict) --

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

                  • AttachTime (datetime) --

                    The time stamp when the attachment initiated.

                  • DeleteOnTermination (boolean) --

                    Indicates whether the volume is deleted on instance termination.

                  • Status (string) --

                    The attachment state.

                  • VolumeId (string) --

                    The ID of the EBS volume.

            • ClientToken (string) --

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

            • EbsOptimized (boolean) --

              Indicates whether the instance is optimized for Amazon 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.

            • EnaSupport (boolean) --

              Specifies whether enhanced networking with ENA is enabled.

            • Hypervisor (string) --

              The hypervisor type of the instance.

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

            • InstanceLifecycle (string) --

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

            • ElasticGpuAssociations (list) --

              The Elastic GPU associated with the instance.

              • (dict) --

                Describes the association between an instance and an Elastic GPU.

                • ElasticGpuId (string) --

                  The ID of the Elastic GPU.

                • ElasticGpuAssociationId (string) --

                  The ID of the association.

                • ElasticGpuAssociationState (string) --

                  The state of the association between the instance and the Elastic GPU.

                • ElasticGpuAssociationTime (string) --

                  The time the Elastic GPU was associated with the instance.

            • NetworkInterfaces (list) --

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

              • (dict) --

                Describes a network interface.

                • Association (dict) --

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

                  • IpOwnerId (string) --

                    The ID of the owner of the Elastic IP address.

                  • PublicDnsName (string) --

                    The public DNS name.

                  • PublicIp (string) --

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

                • Attachment (dict) --

                  The network interface attachment.

                  • AttachTime (datetime) --

                    The time stamp when the attachment initiated.

                  • AttachmentId (string) --

                    The ID of the network interface attachment.

                  • DeleteOnTermination (boolean) --

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

                  • DeviceIndex (integer) --

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

                  • Status (string) --

                    The attachment state.

                • Description (string) --

                  The description.

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

                • Ipv6Addresses (list) --

                  One or more IPv6 addresses associated with the network interface.

                  • (dict) --

                    Describes an IPv6 address.

                    • Ipv6Address (string) --

                      The IPv6 address.

                • MacAddress (string) --

                  The MAC address.

                • NetworkInterfaceId (string) --

                  The ID of the network interface.

                • OwnerId (string) --

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

                • PrivateDnsName (string) --

                  The private DNS name.

                • PrivateIpAddress (string) --

                  The IPv4 address of the network interface within the subnet.

                • PrivateIpAddresses (list) --

                  One or more private IPv4 addresses associated with the network interface.

                  • (dict) --

                    Describes a private IPv4 address.

                    • Association (dict) --

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

                      • IpOwnerId (string) --

                        The ID of the owner of the Elastic IP address.

                      • PublicDnsName (string) --

                        The public DNS name.

                      • PublicIp (string) --

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

                    • Primary (boolean) --

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

                    • PrivateDnsName (string) --

                      The private IPv4 DNS name.

                    • PrivateIpAddress (string) --

                      The private IPv4 address of the network interface.

                • SourceDestCheck (boolean) --

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

                • Status (string) --

                  The status of the network interface.

                • SubnetId (string) --

                  The ID of the subnet.

                • VpcId (string) --

                  The ID of the VPC.

            • RootDeviceName (string) --

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

            • RootDeviceType (string) --

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

            • 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 that checking is enabled, and false means that 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 .

            • SpotInstanceRequestId (string) --

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

            • SriovNetSupport (string) --

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

            • 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.InsufficientInstanceCapacity : There was insufficient instance capacity to satisfy the launch request.

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

                • Server.ScheduledStop : The instance was stopped due to a scheduled retirement.

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

                • 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.InstanceTerminated : The instance was terminated or rebooted during AMI creation.

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

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

            • VirtualizationType (string) --

              The virtualization type of the instance.

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

        • ReservationId (string) --

          The ID of the reservation.

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

DescribeReservedInstances (updated) Link ¶
Changes (response)
{'ReservedInstances': {'InstanceType': {'x1e.16xlarge',
                                        'x1e.2xlarge',
                                        'x1e.4xlarge',
                                        'x1e.8xlarge',
                                        'x1e.xlarge'}}}

Describes one or more of the Reserved Instances that you purchased.

For more information about Reserved Instances, see Reserved Instances in the Amazon Elastic Compute Cloud User Guide .

See also: AWS API Documentation

Request Syntax

client.describe_reserved_instances(
    Filters=[
        {
            'Name': 'string',
            'Values': [
                'string',
            ]
        },
    ],
    OfferingClass='standard'|'convertible',
    ReservedInstancesIds=[
        'string',
    ],
    DryRun=True|False,
    OfferingType='Heavy Utilization'|'Medium Utilization'|'Light Utilization'|'No Upfront'|'Partial Upfront'|'All Upfront'
)
type Filters

list

param Filters

One or more filters.

  • availability-zone - The Availability Zone where the Reserved Instance can be used.

  • duration - The duration of the Reserved Instance (one year or three years), in seconds ( 31536000 | 94608000 ).

  • end - The time when the Reserved Instance expires (for example, 2015-08-07T11:54:42.000Z).

  • fixed-price - The purchase price of the Reserved Instance (for example, 9800.0).

  • instance-type - The instance type that is covered by the reservation.

  • scope - The scope of the Reserved Instance ( Region or Availability Zone ).

  • product-description - The Reserved Instance product platform description. Instances that include (Amazon VPC) in the product platform description will only be displayed to EC2-Classic account holders and are for use with Amazon VPC ( Linux/UNIX | Linux/UNIX (Amazon VPC) | SUSE Linux | SUSE Linux (Amazon VPC) | Red Hat Enterprise Linux | Red Hat Enterprise Linux (Amazon VPC) | Windows | Windows (Amazon VPC) | Windows with SQL Server Standard | Windows with SQL Server Standard (Amazon VPC) | Windows with SQL Server Web | Windows with SQL Server Web (Amazon VPC) | Windows with SQL Server Enterprise | Windows with SQL Server Enterprise (Amazon VPC) ).

  • reserved-instances-id - The ID of the Reserved Instance.

  • start - The time at which the Reserved Instance purchase request was placed (for example, 2014-08-07T11:54:42.000Z).

  • state - The state of the Reserved Instance ( payment-pending | active | payment-failed | retired ).

  • tag :key =*value* - The key/value combination of a tag assigned to the resource. Specify the key of the tag in the filter name and the value of the tag in the filter value. For example, for the tag Purpose=X, specify tag:Purpose for the filter name and X for the filter value.

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

  • usage-price - The usage price of the Reserved Instance, per hour (for example, 0.84).

  • (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 OfferingClass

string

param OfferingClass

Describes whether the Reserved Instance is Standard or Convertible.

type ReservedInstancesIds

list

param ReservedInstancesIds

One or more Reserved Instance IDs.

Default: Describes all your Reserved Instances, or only those otherwise specified.

  • (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 OfferingType

string

param OfferingType

The Reserved Instance offering type. If you are using tools that predate the 2011-11-01 API version, you only have access to the Medium Utilization Reserved Instance offering type.

rtype

dict

returns

Response Syntax

{
    'ReservedInstances': [
        {
            'AvailabilityZone': 'string',
            'Duration': 123,
            'End': datetime(2015, 1, 1),
            'FixedPrice': ...,
            'InstanceCount': 123,
            'InstanceType': 't1.micro'|'t2.nano'|'t2.micro'|'t2.small'|'t2.medium'|'t2.large'|'t2.xlarge'|'t2.2xlarge'|'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'|'m4.16xlarge'|'m2.xlarge'|'m2.2xlarge'|'m2.4xlarge'|'cr1.8xlarge'|'r3.large'|'r3.xlarge'|'r3.2xlarge'|'r3.4xlarge'|'r3.8xlarge'|'r4.large'|'r4.xlarge'|'r4.2xlarge'|'r4.4xlarge'|'r4.8xlarge'|'r4.16xlarge'|'x1.16xlarge'|'x1.32xlarge'|'x1e.xlarge'|'x1e.2xlarge'|'x1e.4xlarge'|'x1e.8xlarge'|'x1e.16xlarge'|'x1e.32xlarge'|'i2.xlarge'|'i2.2xlarge'|'i2.4xlarge'|'i2.8xlarge'|'i3.large'|'i3.xlarge'|'i3.2xlarge'|'i3.4xlarge'|'i3.8xlarge'|'i3.16xlarge'|'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'|'c5.large'|'c5.xlarge'|'c5.2xlarge'|'c5.4xlarge'|'c5.9xlarge'|'c5.18xlarge'|'cc1.4xlarge'|'cc2.8xlarge'|'g2.2xlarge'|'g2.8xlarge'|'g3.4xlarge'|'g3.8xlarge'|'g3.16xlarge'|'cg1.4xlarge'|'p2.xlarge'|'p2.8xlarge'|'p2.16xlarge'|'p3.2xlarge'|'p3.8xlarge'|'p3.16xlarge'|'d2.xlarge'|'d2.2xlarge'|'d2.4xlarge'|'d2.8xlarge'|'f1.2xlarge'|'f1.16xlarge',
            'ProductDescription': 'Linux/UNIX'|'Linux/UNIX (Amazon VPC)'|'Windows'|'Windows (Amazon VPC)',
            'ReservedInstancesId': 'string',
            'Start': datetime(2015, 1, 1),
            'State': 'payment-pending'|'active'|'payment-failed'|'retired',
            'UsagePrice': ...,
            'CurrencyCode': 'USD',
            'InstanceTenancy': 'default'|'dedicated'|'host',
            'OfferingClass': 'standard'|'convertible',
            'OfferingType': 'Heavy Utilization'|'Medium Utilization'|'Light Utilization'|'No Upfront'|'Partial Upfront'|'All Upfront',
            'RecurringCharges': [
                {
                    'Amount': 123.0,
                    'Frequency': 'Hourly'
                },
            ],
            'Scope': 'Availability Zone'|'Region',
            'Tags': [
                {
                    'Key': 'string',
                    'Value': 'string'
                },
            ]
        },
    ]
}

Response Structure

  • (dict) --

    Contains the output for DescribeReservedInstances.

    • ReservedInstances (list) --

      A list of Reserved Instances.

      • (dict) --

        Describes a Reserved Instance.

        • AvailabilityZone (string) --

          The Availability Zone in which the Reserved Instance can be used.

        • Duration (integer) --

          The duration of the Reserved Instance, in seconds.

        • End (datetime) --

          The time when the Reserved Instance expires.

        • FixedPrice (float) --

          The purchase price of the Reserved Instance.

        • InstanceCount (integer) --

          The number of reservations purchased.

        • InstanceType (string) --

          The instance type on which the Reserved Instance can be used.

        • ProductDescription (string) --

          The Reserved Instance product platform description.

        • ReservedInstancesId (string) --

          The ID of the Reserved Instance.

        • Start (datetime) --

          The date and time the Reserved Instance started.

        • State (string) --

          The state of the Reserved Instance purchase.

        • UsagePrice (float) --

          The usage price of the Reserved Instance, per hour.

        • CurrencyCode (string) --

          The currency of the Reserved Instance. It's specified using ISO 4217 standard currency codes. At this time, the only supported currency is USD .

        • InstanceTenancy (string) --

          The tenancy of the instance.

        • OfferingClass (string) --

          The offering class of the Reserved Instance.

        • OfferingType (string) --

          The Reserved Instance offering type.

        • RecurringCharges (list) --

          The recurring charge tag assigned to the resource.

          • (dict) --

            Describes a recurring charge.

            • Amount (float) --

              The amount of the recurring charge.

            • Frequency (string) --

              The frequency of the recurring charge.

        • Scope (string) --

          The scope of the Reserved Instance.

        • Tags (list) --

          Any tags assigned to the resource.

          • (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.

DescribeReservedInstancesModifications (updated) Link ¶
Changes (response)
{'ReservedInstancesModifications': {'ModificationResults': {'TargetConfiguration': {'InstanceType': {'x1e.16xlarge',
                                                                                                     'x1e.2xlarge',
                                                                                                     'x1e.4xlarge',
                                                                                                     'x1e.8xlarge',
                                                                                                     'x1e.xlarge'}}}}}

Describes the modifications made to your Reserved Instances. If no parameter is specified, information about all your Reserved Instances modification requests is returned. If a modification ID is specified, only information about the specific modification is returned.

For more information, see Modifying Reserved Instances in the Amazon Elastic Compute Cloud User Guide.

See also: AWS API Documentation

Request Syntax

client.describe_reserved_instances_modifications(
    Filters=[
        {
            'Name': 'string',
            'Values': [
                'string',
            ]
        },
    ],
    ReservedInstancesModificationIds=[
        'string',
    ],
    NextToken='string'
)
type Filters

list

param Filters

One or more filters.

  • client-token - The idempotency token for the modification request.

  • create-date - The time when the modification request was created.

  • effective-date - The time when the modification becomes effective.

  • modification-result.reserved-instances-id - The ID for the Reserved Instances created as part of the modification request. This ID is only available when the status of the modification is fulfilled .

  • modification-result.target-configuration.availability-zone - The Availability Zone for the new Reserved Instances.

  • modification-result.target-configuration.instance-count - The number of new Reserved Instances.

  • modification-result.target-configuration.instance-type - The instance type of the new Reserved Instances.

  • modification-result.target-configuration.platform - The network platform of the new Reserved Instances ( EC2-Classic | EC2-VPC ).

  • reserved-instances-id - The ID of the Reserved Instances modified.

  • reserved-instances-modification-id - The ID of the modification request.

  • status - The status of the Reserved Instances modification request ( processing | fulfilled | failed ).

  • status-message - The reason for the status.

  • update-date - The time when the modification request was last updated.

  • (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 ReservedInstancesModificationIds

list

param ReservedInstancesModificationIds

IDs for the submitted modification request.

  • (string) --

type NextToken

string

param NextToken

The token to retrieve the next page of results.

rtype

dict

returns

Response Syntax

{
    'NextToken': 'string',
    'ReservedInstancesModifications': [
        {
            'ClientToken': 'string',
            'CreateDate': datetime(2015, 1, 1),
            'EffectiveDate': datetime(2015, 1, 1),
            'ModificationResults': [
                {
                    'ReservedInstancesId': 'string',
                    'TargetConfiguration': {
                        'AvailabilityZone': 'string',
                        'InstanceCount': 123,
                        'InstanceType': 't1.micro'|'t2.nano'|'t2.micro'|'t2.small'|'t2.medium'|'t2.large'|'t2.xlarge'|'t2.2xlarge'|'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'|'m4.16xlarge'|'m2.xlarge'|'m2.2xlarge'|'m2.4xlarge'|'cr1.8xlarge'|'r3.large'|'r3.xlarge'|'r3.2xlarge'|'r3.4xlarge'|'r3.8xlarge'|'r4.large'|'r4.xlarge'|'r4.2xlarge'|'r4.4xlarge'|'r4.8xlarge'|'r4.16xlarge'|'x1.16xlarge'|'x1.32xlarge'|'x1e.xlarge'|'x1e.2xlarge'|'x1e.4xlarge'|'x1e.8xlarge'|'x1e.16xlarge'|'x1e.32xlarge'|'i2.xlarge'|'i2.2xlarge'|'i2.4xlarge'|'i2.8xlarge'|'i3.large'|'i3.xlarge'|'i3.2xlarge'|'i3.4xlarge'|'i3.8xlarge'|'i3.16xlarge'|'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'|'c5.large'|'c5.xlarge'|'c5.2xlarge'|'c5.4xlarge'|'c5.9xlarge'|'c5.18xlarge'|'cc1.4xlarge'|'cc2.8xlarge'|'g2.2xlarge'|'g2.8xlarge'|'g3.4xlarge'|'g3.8xlarge'|'g3.16xlarge'|'cg1.4xlarge'|'p2.xlarge'|'p2.8xlarge'|'p2.16xlarge'|'p3.2xlarge'|'p3.8xlarge'|'p3.16xlarge'|'d2.xlarge'|'d2.2xlarge'|'d2.4xlarge'|'d2.8xlarge'|'f1.2xlarge'|'f1.16xlarge',
                        'Platform': 'string',
                        'Scope': 'Availability Zone'|'Region'
                    }
                },
            ],
            'ReservedInstancesIds': [
                {
                    'ReservedInstancesId': 'string'
                },
            ],
            'ReservedInstancesModificationId': 'string',
            'Status': 'string',
            'StatusMessage': 'string',
            'UpdateDate': datetime(2015, 1, 1)
        },
    ]
}

Response Structure

  • (dict) --

    Contains the output of DescribeReservedInstancesModifications.

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

    • ReservedInstancesModifications (list) --

      The Reserved Instance modification information.

      • (dict) --

        Describes a Reserved Instance modification.

        • ClientToken (string) --

          A unique, case-sensitive key supplied by the client to ensure that the request is idempotent. For more information, see Ensuring Idempotency.

        • CreateDate (datetime) --

          The time when the modification request was created.

        • EffectiveDate (datetime) --

          The time for the modification to become effective.

        • ModificationResults (list) --

          Contains target configurations along with their corresponding new Reserved Instance IDs.

          • (dict) --

            Describes the modification request/s.

            • ReservedInstancesId (string) --

              The ID for the Reserved Instances that were created as part of the modification request. This field is only available when the modification is fulfilled.

            • TargetConfiguration (dict) --

              The target Reserved Instances configurations supplied as part of the modification request.

              • AvailabilityZone (string) --

                The Availability Zone for the modified Reserved Instances.

              • InstanceCount (integer) --

                The number of modified Reserved Instances.

              • InstanceType (string) --

                The instance type for the modified Reserved Instances.

              • Platform (string) --

                The network platform of the modified Reserved Instances, which is either EC2-Classic or EC2-VPC.

              • Scope (string) --

                Whether the Reserved Instance is applied to instances in a region or instances in a specific Availability Zone.

        • ReservedInstancesIds (list) --

          The IDs of one or more Reserved Instances.

          • (dict) --

            Describes the ID of a Reserved Instance.

            • ReservedInstancesId (string) --

              The ID of the Reserved Instance.

        • ReservedInstancesModificationId (string) --

          A unique ID for the Reserved Instance modification.

        • Status (string) --

          The status of the Reserved Instances modification request.

        • StatusMessage (string) --

          The reason for the status.

        • UpdateDate (datetime) --

          The time when the modification request was last updated.

DescribeReservedInstancesOfferings (updated) Link ¶
Changes (request, response)
Request
{'InstanceType': {'x1e.16xlarge',
                  'x1e.2xlarge',
                  'x1e.4xlarge',
                  'x1e.8xlarge',
                  'x1e.xlarge'}}
Response
{'ReservedInstancesOfferings': {'InstanceType': {'x1e.16xlarge',
                                                 'x1e.2xlarge',
                                                 'x1e.4xlarge',
                                                 'x1e.8xlarge',
                                                 'x1e.xlarge'}}}

Describes Reserved Instance offerings that are available for purchase. With Reserved Instances, you purchase the right to launch instances for a period of time. During that time period, you do not receive insufficient capacity errors, and you pay a lower usage rate than the rate charged for On-Demand instances for the actual time used.

If you have listed your own Reserved Instances for sale in the Reserved Instance Marketplace, they will be excluded from these results. This is to ensure that you do not purchase your own Reserved Instances.

For more information, see Reserved Instance Marketplace in the Amazon Elastic Compute Cloud User Guide .

See also: AWS API Documentation

Request Syntax

client.describe_reserved_instances_offerings(
    AvailabilityZone='string',
    Filters=[
        {
            'Name': 'string',
            'Values': [
                'string',
            ]
        },
    ],
    IncludeMarketplace=True|False,
    InstanceType='t1.micro'|'t2.nano'|'t2.micro'|'t2.small'|'t2.medium'|'t2.large'|'t2.xlarge'|'t2.2xlarge'|'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'|'m4.16xlarge'|'m2.xlarge'|'m2.2xlarge'|'m2.4xlarge'|'cr1.8xlarge'|'r3.large'|'r3.xlarge'|'r3.2xlarge'|'r3.4xlarge'|'r3.8xlarge'|'r4.large'|'r4.xlarge'|'r4.2xlarge'|'r4.4xlarge'|'r4.8xlarge'|'r4.16xlarge'|'x1.16xlarge'|'x1.32xlarge'|'x1e.xlarge'|'x1e.2xlarge'|'x1e.4xlarge'|'x1e.8xlarge'|'x1e.16xlarge'|'x1e.32xlarge'|'i2.xlarge'|'i2.2xlarge'|'i2.4xlarge'|'i2.8xlarge'|'i3.large'|'i3.xlarge'|'i3.2xlarge'|'i3.4xlarge'|'i3.8xlarge'|'i3.16xlarge'|'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'|'c5.large'|'c5.xlarge'|'c5.2xlarge'|'c5.4xlarge'|'c5.9xlarge'|'c5.18xlarge'|'cc1.4xlarge'|'cc2.8xlarge'|'g2.2xlarge'|'g2.8xlarge'|'g3.4xlarge'|'g3.8xlarge'|'g3.16xlarge'|'cg1.4xlarge'|'p2.xlarge'|'p2.8xlarge'|'p2.16xlarge'|'p3.2xlarge'|'p3.8xlarge'|'p3.16xlarge'|'d2.xlarge'|'d2.2xlarge'|'d2.4xlarge'|'d2.8xlarge'|'f1.2xlarge'|'f1.16xlarge',
    MaxDuration=123,
    MaxInstanceCount=123,
    MinDuration=123,
    OfferingClass='standard'|'convertible',
    ProductDescription='Linux/UNIX'|'Linux/UNIX (Amazon VPC)'|'Windows'|'Windows (Amazon VPC)',
    ReservedInstancesOfferingIds=[
        'string',
    ],
    DryRun=True|False,
    InstanceTenancy='default'|'dedicated'|'host',
    MaxResults=123,
    NextToken='string',
    OfferingType='Heavy Utilization'|'Medium Utilization'|'Light Utilization'|'No Upfront'|'Partial Upfront'|'All Upfront'
)
type AvailabilityZone

string

param AvailabilityZone

The Availability Zone in which the Reserved Instance can be used.

type Filters

list

param Filters

One or more filters.

  • availability-zone - The Availability Zone where the Reserved Instance can be used.

  • duration - The duration of the Reserved Instance (for example, one year or three years), in seconds ( 31536000 | 94608000 ).

  • fixed-price - The purchase price of the Reserved Instance (for example, 9800.0).

  • instance-type - The instance type that is covered by the reservation.

  • marketplace - Set to true to show only Reserved Instance Marketplace offerings. When this filter is not used, which is the default behavior, all offerings from both AWS and the Reserved Instance Marketplace are listed.

  • product-description - The Reserved Instance product platform description. Instances that include (Amazon VPC) in the product platform description will only be displayed to EC2-Classic account holders and are for use with Amazon VPC. ( Linux/UNIX | Linux/UNIX (Amazon VPC) | SUSE Linux | SUSE Linux (Amazon VPC) | Red Hat Enterprise Linux | Red Hat Enterprise Linux (Amazon VPC) | Windows | Windows (Amazon VPC) | Windows with SQL Server Standard | Windows with SQL Server Standard (Amazon VPC) | Windows with SQL Server Web | Windows with SQL Server Web (Amazon VPC) | Windows with SQL Server Enterprise | Windows with SQL Server Enterprise (Amazon VPC) )

  • reserved-instances-offering-id - The Reserved Instances offering ID.

  • scope - The scope of the Reserved Instance ( Availability Zone or Region ).

  • usage-price - The usage price of the Reserved Instance, per hour (for example, 0.84).

  • (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 IncludeMarketplace

boolean

param IncludeMarketplace

Include Reserved Instance Marketplace offerings in the response.

type InstanceType

string

param InstanceType

The instance type that the reservation will cover (for example, m1.small ). For more information, see Instance Types in the Amazon Elastic Compute Cloud User Guide .

type MaxDuration

integer

param MaxDuration

The maximum duration (in seconds) to filter when searching for offerings.

Default: 94608000 (3 years)

type MaxInstanceCount

integer

param MaxInstanceCount

The maximum number of instances to filter when searching for offerings.

Default: 20

type MinDuration

integer

param MinDuration

The minimum duration (in seconds) to filter when searching for offerings.

Default: 2592000 (1 month)

type OfferingClass

string

param OfferingClass

The offering class of the Reserved Instance. Can be standard or convertible .

type ProductDescription

string

param ProductDescription

The Reserved Instance product platform description. Instances that include (Amazon VPC) in the description are for use with Amazon VPC.

type ReservedInstancesOfferingIds

list

param ReservedInstancesOfferingIds

One or more Reserved Instances offering IDs.

  • (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 InstanceTenancy

string

param InstanceTenancy

The tenancy of the instances covered by the reservation. A Reserved Instance with a tenancy of dedicated is applied to instances that run in a VPC on single-tenant hardware (i.e., Dedicated Instances).

Important: The host value cannot be used with this parameter. Use the default or dedicated values only.

Default: default

type MaxResults

integer

param MaxResults

The maximum number of results to return for the request in a single page. The remaining results of the initial request can be seen by sending another request with the returned NextToken value. The maximum is 100.

Default: 100

type NextToken

string

param NextToken

The token to retrieve the next page of results.

type OfferingType

string

param OfferingType

The Reserved Instance offering type. If you are using tools that predate the 2011-11-01 API version, you only have access to the Medium Utilization Reserved Instance offering type.

rtype

dict

returns

Response Syntax

{
    'ReservedInstancesOfferings': [
        {
            'AvailabilityZone': 'string',
            'Duration': 123,
            'FixedPrice': ...,
            'InstanceType': 't1.micro'|'t2.nano'|'t2.micro'|'t2.small'|'t2.medium'|'t2.large'|'t2.xlarge'|'t2.2xlarge'|'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'|'m4.16xlarge'|'m2.xlarge'|'m2.2xlarge'|'m2.4xlarge'|'cr1.8xlarge'|'r3.large'|'r3.xlarge'|'r3.2xlarge'|'r3.4xlarge'|'r3.8xlarge'|'r4.large'|'r4.xlarge'|'r4.2xlarge'|'r4.4xlarge'|'r4.8xlarge'|'r4.16xlarge'|'x1.16xlarge'|'x1.32xlarge'|'x1e.xlarge'|'x1e.2xlarge'|'x1e.4xlarge'|'x1e.8xlarge'|'x1e.16xlarge'|'x1e.32xlarge'|'i2.xlarge'|'i2.2xlarge'|'i2.4xlarge'|'i2.8xlarge'|'i3.large'|'i3.xlarge'|'i3.2xlarge'|'i3.4xlarge'|'i3.8xlarge'|'i3.16xlarge'|'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'|'c5.large'|'c5.xlarge'|'c5.2xlarge'|'c5.4xlarge'|'c5.9xlarge'|'c5.18xlarge'|'cc1.4xlarge'|'cc2.8xlarge'|'g2.2xlarge'|'g2.8xlarge'|'g3.4xlarge'|'g3.8xlarge'|'g3.16xlarge'|'cg1.4xlarge'|'p2.xlarge'|'p2.8xlarge'|'p2.16xlarge'|'p3.2xlarge'|'p3.8xlarge'|'p3.16xlarge'|'d2.xlarge'|'d2.2xlarge'|'d2.4xlarge'|'d2.8xlarge'|'f1.2xlarge'|'f1.16xlarge',
            'ProductDescription': 'Linux/UNIX'|'Linux/UNIX (Amazon VPC)'|'Windows'|'Windows (Amazon VPC)',
            'ReservedInstancesOfferingId': 'string',
            'UsagePrice': ...,
            'CurrencyCode': 'USD',
            'InstanceTenancy': 'default'|'dedicated'|'host',
            'Marketplace': True|False,
            'OfferingClass': 'standard'|'convertible',
            'OfferingType': 'Heavy Utilization'|'Medium Utilization'|'Light Utilization'|'No Upfront'|'Partial Upfront'|'All Upfront',
            'PricingDetails': [
                {
                    'Count': 123,
                    'Price': 123.0
                },
            ],
            'RecurringCharges': [
                {
                    'Amount': 123.0,
                    'Frequency': 'Hourly'
                },
            ],
            'Scope': 'Availability Zone'|'Region'
        },
    ],
    'NextToken': 'string'
}

Response Structure

  • (dict) --

    Contains the output of DescribeReservedInstancesOfferings.

    • ReservedInstancesOfferings (list) --

      A list of Reserved Instances offerings.

      • (dict) --

        Describes a Reserved Instance offering.

        • AvailabilityZone (string) --

          The Availability Zone in which the Reserved Instance can be used.

        • Duration (integer) --

          The duration of the Reserved Instance, in seconds.

        • FixedPrice (float) --

          The purchase price of the Reserved Instance.

        • InstanceType (string) --

          The instance type on which the Reserved Instance can be used.

        • ProductDescription (string) --

          The Reserved Instance product platform description.

        • ReservedInstancesOfferingId (string) --

          The ID of the Reserved Instance offering. This is the offering ID used in GetReservedInstancesExchangeQuote to confirm that an exchange can be made.

        • UsagePrice (float) --

          The usage price of the Reserved Instance, per hour.

        • CurrencyCode (string) --

          The currency of the Reserved Instance offering you are purchasing. It's specified using ISO 4217 standard currency codes. At this time, the only supported currency is USD .

        • InstanceTenancy (string) --

          The tenancy of the instance.

        • Marketplace (boolean) --

          Indicates whether the offering is available through the Reserved Instance Marketplace (resale) or AWS. If it's a Reserved Instance Marketplace offering, this is true .

        • OfferingClass (string) --

          If convertible it can be exchanged for Reserved Instances of the same or higher monetary value, with different configurations. If standard , it is not possible to perform an exchange.

        • OfferingType (string) --

          The Reserved Instance offering type.

        • PricingDetails (list) --

          The pricing details of the Reserved Instance offering.

          • (dict) --

            Describes a Reserved Instance offering.

            • Count (integer) --

              The number of reservations available for the price.

            • Price (float) --

              The price per instance.

        • RecurringCharges (list) --

          The recurring charge tag assigned to the resource.

          • (dict) --

            Describes a recurring charge.

            • Amount (float) --

              The amount of the recurring charge.

            • Frequency (string) --

              The frequency of the recurring charge.

        • Scope (string) --

          Whether the Reserved Instance is applied to instances in a region or an Availability Zone.

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

DescribeSpotFleetRequests (updated) Link ¶
Changes (response)
{'SpotFleetRequestConfigs': {'SpotFleetRequestConfig': {'LaunchSpecifications': {'InstanceType': {'x1e.16xlarge',
                                                                                                  'x1e.2xlarge',
                                                                                                  'x1e.4xlarge',
                                                                                                  'x1e.8xlarge',
                                                                                                  'x1e.xlarge'}}}}}

Describes your Spot fleet requests.

Spot fleet requests are deleted 48 hours after they are canceled and their instances are terminated.

See also: AWS API Documentation

Request Syntax

client.describe_spot_fleet_requests(
    DryRun=True|False,
    MaxResults=123,
    NextToken='string',
    SpotFleetRequestIds=[
        '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 MaxResults

integer

param MaxResults

The maximum number of results to return in a single call. Specify a value between 1 and 1000. The default value is 1000. To retrieve the remaining results, make another call with the returned NextToken value.

type NextToken

string

param NextToken

The token for the next set of results.

type SpotFleetRequestIds

list

param SpotFleetRequestIds

The IDs of the Spot fleet requests.

  • (string) --

rtype

dict

returns

Response Syntax

{
    'NextToken': 'string',
    'SpotFleetRequestConfigs': [
        {
            'ActivityStatus': 'error'|'pending_fulfillment'|'pending_termination'|'fulfilled',
            'CreateTime': datetime(2015, 1, 1),
            'SpotFleetRequestConfig': {
                'AllocationStrategy': 'lowestPrice'|'diversified',
                'ClientToken': 'string',
                'ExcessCapacityTerminationPolicy': 'noTermination'|'default',
                'FulfilledCapacity': 123.0,
                'IamFleetRole': 'string',
                'LaunchSpecifications': [
                    {
                        'SecurityGroups': [
                            {
                                'GroupName': 'string',
                                'GroupId': 'string'
                            },
                        ],
                        'AddressingType': 'string',
                        'BlockDeviceMappings': [
                            {
                                'DeviceName': 'string',
                                'VirtualName': 'string',
                                'Ebs': {
                                    'Encrypted': True|False,
                                    'DeleteOnTermination': True|False,
                                    'Iops': 123,
                                    'SnapshotId': 'string',
                                    'VolumeSize': 123,
                                    'VolumeType': 'standard'|'io1'|'gp2'|'sc1'|'st1'
                                },
                                'NoDevice': 'string'
                            },
                        ],
                        'EbsOptimized': True|False,
                        'IamInstanceProfile': {
                            'Arn': 'string',
                            'Name': 'string'
                        },
                        'ImageId': 'string',
                        'InstanceType': 't1.micro'|'t2.nano'|'t2.micro'|'t2.small'|'t2.medium'|'t2.large'|'t2.xlarge'|'t2.2xlarge'|'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'|'m4.16xlarge'|'m2.xlarge'|'m2.2xlarge'|'m2.4xlarge'|'cr1.8xlarge'|'r3.large'|'r3.xlarge'|'r3.2xlarge'|'r3.4xlarge'|'r3.8xlarge'|'r4.large'|'r4.xlarge'|'r4.2xlarge'|'r4.4xlarge'|'r4.8xlarge'|'r4.16xlarge'|'x1.16xlarge'|'x1.32xlarge'|'x1e.xlarge'|'x1e.2xlarge'|'x1e.4xlarge'|'x1e.8xlarge'|'x1e.16xlarge'|'x1e.32xlarge'|'i2.xlarge'|'i2.2xlarge'|'i2.4xlarge'|'i2.8xlarge'|'i3.large'|'i3.xlarge'|'i3.2xlarge'|'i3.4xlarge'|'i3.8xlarge'|'i3.16xlarge'|'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'|'c5.large'|'c5.xlarge'|'c5.2xlarge'|'c5.4xlarge'|'c5.9xlarge'|'c5.18xlarge'|'cc1.4xlarge'|'cc2.8xlarge'|'g2.2xlarge'|'g2.8xlarge'|'g3.4xlarge'|'g3.8xlarge'|'g3.16xlarge'|'cg1.4xlarge'|'p2.xlarge'|'p2.8xlarge'|'p2.16xlarge'|'p3.2xlarge'|'p3.8xlarge'|'p3.16xlarge'|'d2.xlarge'|'d2.2xlarge'|'d2.4xlarge'|'d2.8xlarge'|'f1.2xlarge'|'f1.16xlarge',
                        'KernelId': 'string',
                        'KeyName': 'string',
                        'Monitoring': {
                            'Enabled': True|False
                        },
                        'NetworkInterfaces': [
                            {
                                'AssociatePublicIpAddress': True|False,
                                'DeleteOnTermination': True|False,
                                'Description': 'string',
                                'DeviceIndex': 123,
                                'Groups': [
                                    'string',
                                ],
                                'Ipv6AddressCount': 123,
                                'Ipv6Addresses': [
                                    {
                                        'Ipv6Address': 'string'
                                    },
                                ],
                                'NetworkInterfaceId': 'string',
                                'PrivateIpAddress': 'string',
                                'PrivateIpAddresses': [
                                    {
                                        'Primary': True|False,
                                        'PrivateIpAddress': 'string'
                                    },
                                ],
                                'SecondaryPrivateIpAddressCount': 123,
                                'SubnetId': 'string'
                            },
                        ],
                        'Placement': {
                            'AvailabilityZone': 'string',
                            'GroupName': 'string',
                            'Tenancy': 'default'|'dedicated'|'host'
                        },
                        'RamdiskId': 'string',
                        'SpotPrice': 'string',
                        'SubnetId': 'string',
                        'UserData': 'string',
                        'WeightedCapacity': 123.0,
                        'TagSpecifications': [
                            {
                                'ResourceType': 'customer-gateway'|'dhcp-options'|'image'|'instance'|'internet-gateway'|'network-acl'|'network-interface'|'reserved-instances'|'route-table'|'snapshot'|'spot-instances-request'|'subnet'|'security-group'|'volume'|'vpc'|'vpn-connection'|'vpn-gateway',
                                'Tags': [
                                    {
                                        'Key': 'string',
                                        'Value': 'string'
                                    },
                                ]
                            },
                        ]
                    },
                ],
                'SpotPrice': 'string',
                'TargetCapacity': 123,
                'TerminateInstancesWithExpiration': True|False,
                'Type': 'request'|'maintain',
                'ValidFrom': datetime(2015, 1, 1),
                'ValidUntil': datetime(2015, 1, 1),
                'ReplaceUnhealthyInstances': True|False,
                'InstanceInterruptionBehavior': 'stop'|'terminate',
                'LoadBalancersConfig': {
                    'ClassicLoadBalancersConfig': {
                        'ClassicLoadBalancers': [
                            {
                                'Name': 'string'
                            },
                        ]
                    },
                    'TargetGroupsConfig': {
                        'TargetGroups': [
                            {
                                'Arn': 'string'
                            },
                        ]
                    }
                }
            },
            'SpotFleetRequestId': 'string',
            'SpotFleetRequestState': 'submitted'|'active'|'cancelled'|'failed'|'cancelled_running'|'cancelled_terminating'|'modifying'
        },
    ]
}

Response Structure

  • (dict) --

    Contains the output of DescribeSpotFleetRequests.

    • NextToken (string) --

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

    • SpotFleetRequestConfigs (list) --

      Information about the configuration of your Spot fleet.

      • (dict) --

        Describes a Spot fleet request.

        • ActivityStatus (string) --

          The progress of the Spot fleet request. If there is an error, the status is error . After all bids are placed, the status is pending_fulfillment . If the size of the fleet is equal to or greater than its target capacity, the status is fulfilled . If the size of the fleet is decreased, the status is pending_termination while Spot instances are terminating.

        • CreateTime (datetime) --

          The creation date and time of the request.

        • SpotFleetRequestConfig (dict) --

          Information about the configuration of the Spot fleet request.

          • AllocationStrategy (string) --

            Indicates how to allocate the target capacity across the Spot pools specified by the Spot fleet request. The default is lowestPrice .

          • ClientToken (string) --

            A unique, case-sensitive identifier you provide to ensure idempotency of your listings. This helps avoid duplicate listings. For more information, see Ensuring Idempotency.

          • ExcessCapacityTerminationPolicy (string) --

            Indicates whether running Spot instances should be terminated if the target capacity of the Spot fleet request is decreased below the current size of the Spot fleet.

          • FulfilledCapacity (float) --

            The number of units fulfilled by this request compared to the set target capacity.

          • IamFleetRole (string) --

            Grants the Spot fleet permission to terminate Spot instances on your behalf when you cancel its Spot fleet request using CancelSpotFleetRequests or when the Spot fleet request expires, if you set terminateInstancesWithExpiration .

          • LaunchSpecifications (list) --

            Information about the launch specifications for the Spot fleet request.

            • (dict) --

              Describes the launch specification for one or more Spot instances.

              • SecurityGroups (list) --

                One or more security groups. When requesting instances in a VPC, you must specify the IDs of the security groups. When requesting instances in EC2-Classic, you can specify the names or the IDs of the security groups.

                • (dict) --

                  Describes a security group.

                  • GroupName (string) --

                    The name of the security group.

                  • GroupId (string) --

                    The ID of the security group.

              • AddressingType (string) --

                Deprecated.

              • BlockDeviceMappings (list) --

                One or more block device mapping entries. You can't specify both a snapshot ID and an encryption value. This is because only blank volumes can be encrypted on creation. If a snapshot is the basis for a volume, it is not blank and its encryption status is used for the volume encryption status.

                • (dict) --

                  Describes a block device mapping.

                  • DeviceName (string) --

                    The device name (for example, /dev/sdh or xvdh ).

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

                  • Ebs (dict) --

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

                    • Encrypted (boolean) --

                      Indicates whether the EBS volume is encrypted. Encrypted volumes can only be attached to instances that support Amazon EBS encryption. If you are creating a volume from a snapshot, you can't specify an encryption value. This is because only blank volumes can be encrypted on creation.

                    • DeleteOnTermination (boolean) --

                      Indicates whether the EBS volume is deleted on instance termination.

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

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

                    • VolumeType (string) --

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

                      Default: standard

                  • NoDevice (string) --

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

              • EbsOptimized (boolean) --

                Indicates whether the instances are 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

              • IamInstanceProfile (dict) --

                The IAM instance profile.

                • Arn (string) --

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

                • Name (string) --

                  The name of the instance profile.

              • ImageId (string) --

                The ID of the AMI.

              • InstanceType (string) --

                The instance type. Note that T2 and HS1 instance types are not supported.

              • KernelId (string) --

                The ID of the kernel.

              • KeyName (string) --

                The name of the key pair.

              • Monitoring (dict) --

                Enable or disable monitoring for the instances.

                • Enabled (boolean) --

                  Enables monitoring for the instance.

                  Default: false

              • NetworkInterfaces (list) --

                One or more network interfaces. If you specify a network interface, you must specify subnet IDs and security group IDs using the network interface.

                • (dict) --

                  Describes a network interface.

                  • AssociatePublicIpAddress (boolean) --

                    Indicates whether to assign a public IPv4 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 .

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

                  • Description (string) --

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

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

                  • Groups (list) --

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

                    • (string) --

                  • Ipv6AddressCount (integer) --

                    A number of IPv6 addresses to assign to the network interface. Amazon EC2 chooses the IPv6 addresses from the range of the subnet. You cannot specify this option and the option to assign specific IPv6 addresses in the same request. You can specify this option if you've specified a minimum number of instances to launch.

                  • Ipv6Addresses (list) --

                    One or more IPv6 addresses to assign to the network interface. You cannot specify this option and the option to assign a number of IPv6 addresses in the same request. You cannot specify this option if you've specified a minimum number of instances to launch.

                    • (dict) --

                      Describes an IPv6 address.

                      • Ipv6Address (string) --

                        The IPv6 address.

                  • NetworkInterfaceId (string) --

                    The ID of the network interface.

                  • PrivateIpAddress (string) --

                    The private IPv4 address of the network interface. Applies only if creating a network interface when launching an instance. You cannot specify this option if you're launching more than one instance in a RunInstances request.

                  • PrivateIpAddresses (list) --

                    One or more private IPv4 addresses to assign to the network interface. Only one private IPv4 address can be designated as primary. You cannot specify this option if you're launching more than one instance in a RunInstances request.

                    • (dict) --

                      Describes a secondary private IPv4 address for a network interface.

                      • Primary (boolean) --

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

                      • PrivateIpAddress (string) --

                        The private IPv4 addresses.

                  • SecondaryPrivateIpAddressCount (integer) --

                    The number of secondary private IPv4 addresses. You can't specify this option and specify more than one private IP address using the private IP addresses option. You cannot specify this option if you're launching more than one instance in a RunInstances request.

                  • SubnetId (string) --

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

              • Placement (dict) --

                The placement information.

                • AvailabilityZone (string) --

                  The Availability Zone.

                  [Spot fleet only] To specify multiple Availability Zones, separate them using commas; for example, "us-west-2a, us-west-2b".

                • GroupName (string) --

                  The name of the placement group (for cluster 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 Spot instances.

              • RamdiskId (string) --

                The ID of the RAM disk.

              • SpotPrice (string) --

                The bid price per unit hour for the specified instance type. If this value is not specified, the default is the Spot bid price specified for the fleet. To determine the bid price per unit hour, divide the Spot bid price by the value of WeightedCapacity .

              • SubnetId (string) --

                The ID of the subnet in which to launch the instances. To specify multiple subnets, separate them using commas; for example, "subnet-a61dafcf, subnet-65ea5f08".

              • UserData (string) --

                The user data to make available to the instances. 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.

              • WeightedCapacity (float) --

                The number of units provided by the specified instance type. These are the same units that you chose to set the target capacity in terms (instances or a performance characteristic such as vCPUs, memory, or I/O).

                If the target capacity divided by this value is not a whole number, we round the number of instances to the next whole number. If this value is not specified, the default is 1.

              • TagSpecifications (list) --

                The tags to apply during creation.

                • (dict) --

                  The tags for a Spot fleet resource.

                  • ResourceType (string) --

                    The type of resource. Currently, the only resource type that is supported is instance .

                  • Tags (list) --

                    The tags.

                    • (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.

          • SpotPrice (string) --

            The bid price per unit hour.

          • TargetCapacity (integer) --

            The number of units to request. You can choose to set the target capacity in terms of instances or a performance characteristic that is important to your application workload, such as vCPUs, memory, or I/O.

          • TerminateInstancesWithExpiration (boolean) --

            Indicates whether running Spot instances should be terminated when the Spot fleet request expires.

          • Type (string) --

            The type of request. Indicates whether the fleet will only request the target capacity or also attempt to maintain it. When you request a certain target capacity, the fleet will only place the required bids. It will not attempt to replenish Spot instances if capacity is diminished, nor will it submit bids in alternative Spot pools if capacity is not available. When you want to maintain a certain target capacity, fleet will place the required bids to meet this target capacity. It will also automatically replenish any interrupted instances. Default: maintain .

          • ValidFrom (datetime) --

            The start date and time of the request, in UTC format (for example, YYYY -MM -DD T*HH* :MM :SS Z). The default is to start fulfilling the request immediately.

          • ValidUntil (datetime) --

            The end date and time of the request, in UTC format (for example, YYYY -MM -DD T*HH* :MM :SS Z). At this point, no new Spot instance requests are placed or enabled to fulfill the request.

          • ReplaceUnhealthyInstances (boolean) --

            Indicates whether Spot fleet should replace unhealthy instances.

          • InstanceInterruptionBehavior (string) --

            Indicates whether a Spot instance stops or terminates when it is interrupted.

          • LoadBalancersConfig (dict) --

            One or more Classic Load Balancers and target groups to attach to the Spot fleet request. Spot fleet registers the running Spot instances with the specified Classic Load Balancers and target groups.

            With Network Load Balancers, Spot fleet cannot register instances that have the following instance types: C1, CC1, CC2, CG1, CG2, CR1, CS1, G1, G2, HI1, HS1, M1, M2, M3, and T1.

            • ClassicLoadBalancersConfig (dict) --

              The Classic Load Balancers.

              • ClassicLoadBalancers (list) --

                One or more Classic Load Balancers.

                • (dict) --

                  Describes a Classic Load Balancer.

                  • Name (string) --

                    The name of the load balancer.

            • TargetGroupsConfig (dict) --

              The target groups.

              • TargetGroups (list) --

                One or more target groups.

                • (dict) --

                  Describes a load balancer target group.

                  • Arn (string) --

                    The Amazon Resource Name (ARN) of the target group.

        • SpotFleetRequestId (string) --

          The ID of the Spot fleet request.

        • SpotFleetRequestState (string) --

          The state of the Spot fleet request.

DescribeSpotInstanceRequests (updated) Link ¶
Changes (response)
{'SpotInstanceRequests': {'LaunchSpecification': {'InstanceType': {'x1e.16xlarge',
                                                                   'x1e.2xlarge',
                                                                   'x1e.4xlarge',
                                                                   'x1e.8xlarge',
                                                                   'x1e.xlarge'}}}}

Describes the Spot instance requests that belong to your account. Spot instances are instances that Amazon EC2 launches when the bid price that you specify exceeds the current Spot price. Amazon EC2 periodically sets the Spot price based on available Spot instance capacity and current Spot instance requests. For more information, see Spot Instance Requests in the Amazon Elastic Compute Cloud User Guide .

You can use DescribeSpotInstanceRequests to find a running Spot instance by examining the response. If the status of the Spot instance is fulfilled , the instance ID appears in the response and contains the identifier of the instance. Alternatively, you can use DescribeInstances with a filter to look for instances where the instance lifecycle is spot .

Spot instance requests are deleted 4 hours after they are canceled and their instances are terminated.

See also: AWS API Documentation

Request Syntax

client.describe_spot_instance_requests(
    Filters=[
        {
            'Name': 'string',
            'Values': [
                'string',
            ]
        },
    ],
    DryRun=True|False,
    SpotInstanceRequestIds=[
        'string',
    ]
)
type Filters

list

param Filters

One or more filters.

  • availability-zone-group - The Availability Zone group.

  • create-time - The time stamp when the Spot instance request was created.

  • fault-code - The fault code related to the request.

  • fault-message - The fault message related to the request.

  • instance-id - The ID of the instance that fulfilled the request.

  • launch-group - The Spot instance launch group.

  • launch.block-device-mapping.delete-on-termination - Indicates whether the EBS volume is deleted on instance termination.

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

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

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

  • launch.block-device-mapping.volume-type - The type of EBS volume: gp2 for General Purpose SSD, io1 for Provisioned IOPS SSD, st1 for Throughput Optimized HDD, sc1 for Cold HDD, or standard for Magnetic.

  • launch.group-id - The security group for the instance.

  • launch.image-id - The ID of the AMI.

  • launch.instance-type - The type of instance (for example, m3.medium ).

  • launch.kernel-id - The kernel ID.

  • launch.key-name - The name of the key pair the instance launched with.

  • launch.monitoring-enabled - Whether detailed monitoring is enabled for the Spot instance.

  • launch.ramdisk-id - The RAM disk ID.

  • launched-availability-zone - The Availability Zone in which the bid is launched.

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

  • network-interface.delete-on-termination - Indicates whether the network interface is deleted when the instance is terminated.

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

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

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

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

  • network-interface.private-ip-address - The primary private IP address of the network interface.

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

  • product-description - The product description associated with the instance ( Linux/UNIX | Windows ).

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

  • spot-price - The maximum hourly price for any Spot instance launched to fulfill the request.

  • state - The state of the Spot instance request ( open | active | closed | cancelled | failed ). Spot bid status information can help you track your Amazon EC2 Spot instance requests. For more information, see Spot Bid Status in the Amazon Elastic Compute Cloud User Guide.

  • status-code - The short code describing the most recent evaluation of your Spot instance request.

  • status-message - The message explaining the status of the Spot instance request.

  • tag :key =*value* - The key/value combination of a tag assigned to the resource. Specify the key of the tag in the filter name and the value of the tag in the filter value. For example, for the tag Purpose=X, specify tag:Purpose for the filter name and X for the filter value.

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

  • type - The type of Spot instance request ( one-time | persistent ).

  • valid-from - The start date of the request.

  • valid-until - The end date of the request.

  • (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 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 SpotInstanceRequestIds

list

param SpotInstanceRequestIds

One or more Spot instance request IDs.

  • (string) --

rtype

dict

returns

Response Syntax

{
    'SpotInstanceRequests': [
        {
            'ActualBlockHourlyPrice': 'string',
            'AvailabilityZoneGroup': 'string',
            'BlockDurationMinutes': 123,
            'CreateTime': datetime(2015, 1, 1),
            'Fault': {
                'Code': 'string',
                'Message': 'string'
            },
            'InstanceId': 'string',
            'LaunchGroup': 'string',
            'LaunchSpecification': {
                'UserData': 'string',
                'SecurityGroups': [
                    {
                        'GroupName': 'string',
                        'GroupId': 'string'
                    },
                ],
                'AddressingType': 'string',
                'BlockDeviceMappings': [
                    {
                        'DeviceName': 'string',
                        'VirtualName': 'string',
                        'Ebs': {
                            'Encrypted': True|False,
                            'DeleteOnTermination': True|False,
                            'Iops': 123,
                            'SnapshotId': 'string',
                            'VolumeSize': 123,
                            'VolumeType': 'standard'|'io1'|'gp2'|'sc1'|'st1'
                        },
                        'NoDevice': 'string'
                    },
                ],
                'EbsOptimized': True|False,
                'IamInstanceProfile': {
                    'Arn': 'string',
                    'Name': 'string'
                },
                'ImageId': 'string',
                'InstanceType': 't1.micro'|'t2.nano'|'t2.micro'|'t2.small'|'t2.medium'|'t2.large'|'t2.xlarge'|'t2.2xlarge'|'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'|'m4.16xlarge'|'m2.xlarge'|'m2.2xlarge'|'m2.4xlarge'|'cr1.8xlarge'|'r3.large'|'r3.xlarge'|'r3.2xlarge'|'r3.4xlarge'|'r3.8xlarge'|'r4.large'|'r4.xlarge'|'r4.2xlarge'|'r4.4xlarge'|'r4.8xlarge'|'r4.16xlarge'|'x1.16xlarge'|'x1.32xlarge'|'x1e.xlarge'|'x1e.2xlarge'|'x1e.4xlarge'|'x1e.8xlarge'|'x1e.16xlarge'|'x1e.32xlarge'|'i2.xlarge'|'i2.2xlarge'|'i2.4xlarge'|'i2.8xlarge'|'i3.large'|'i3.xlarge'|'i3.2xlarge'|'i3.4xlarge'|'i3.8xlarge'|'i3.16xlarge'|'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'|'c5.large'|'c5.xlarge'|'c5.2xlarge'|'c5.4xlarge'|'c5.9xlarge'|'c5.18xlarge'|'cc1.4xlarge'|'cc2.8xlarge'|'g2.2xlarge'|'g2.8xlarge'|'g3.4xlarge'|'g3.8xlarge'|'g3.16xlarge'|'cg1.4xlarge'|'p2.xlarge'|'p2.8xlarge'|'p2.16xlarge'|'p3.2xlarge'|'p3.8xlarge'|'p3.16xlarge'|'d2.xlarge'|'d2.2xlarge'|'d2.4xlarge'|'d2.8xlarge'|'f1.2xlarge'|'f1.16xlarge',
                'KernelId': 'string',
                'KeyName': 'string',
                'NetworkInterfaces': [
                    {
                        'AssociatePublicIpAddress': True|False,
                        'DeleteOnTermination': True|False,
                        'Description': 'string',
                        'DeviceIndex': 123,
                        'Groups': [
                            'string',
                        ],
                        'Ipv6AddressCount': 123,
                        'Ipv6Addresses': [
                            {
                                'Ipv6Address': 'string'
                            },
                        ],
                        'NetworkInterfaceId': 'string',
                        'PrivateIpAddress': 'string',
                        'PrivateIpAddresses': [
                            {
                                'Primary': True|False,
                                'PrivateIpAddress': 'string'
                            },
                        ],
                        'SecondaryPrivateIpAddressCount': 123,
                        'SubnetId': 'string'
                    },
                ],
                'Placement': {
                    'AvailabilityZone': 'string',
                    'GroupName': 'string',
                    'Tenancy': 'default'|'dedicated'|'host'
                },
                'RamdiskId': 'string',
                'SubnetId': 'string',
                'Monitoring': {
                    'Enabled': True|False
                }
            },
            'LaunchedAvailabilityZone': 'string',
            'ProductDescription': 'Linux/UNIX'|'Linux/UNIX (Amazon VPC)'|'Windows'|'Windows (Amazon VPC)',
            'SpotInstanceRequestId': 'string',
            'SpotPrice': 'string',
            'State': 'open'|'active'|'closed'|'cancelled'|'failed',
            'Status': {
                'Code': 'string',
                'Message': 'string',
                'UpdateTime': datetime(2015, 1, 1)
            },
            'Tags': [
                {
                    'Key': 'string',
                    'Value': 'string'
                },
            ],
            'Type': 'one-time'|'persistent',
            'ValidFrom': datetime(2015, 1, 1),
            'ValidUntil': datetime(2015, 1, 1),
            'InstanceInterruptionBehavior': 'stop'|'terminate'
        },
    ]
}

Response Structure

  • (dict) --

    Contains the output of DescribeSpotInstanceRequests.

    • SpotInstanceRequests (list) --

      One or more Spot instance requests.

      • (dict) --

        Describes a Spot instance request.

        • ActualBlockHourlyPrice (string) --

          If you specified a duration and your Spot instance request was fulfilled, this is the fixed hourly price in effect for the Spot instance while it runs.

        • AvailabilityZoneGroup (string) --

          The Availability Zone group. If you specify the same Availability Zone group for all Spot instance requests, all Spot instances are launched in the same Availability Zone.

        • BlockDurationMinutes (integer) --

          The duration for the Spot instance, in minutes.

        • CreateTime (datetime) --

          The date and time when the Spot instance request was created, in UTC format (for example, YYYY -MM -DD T*HH* :MM :SS Z).

        • Fault (dict) --

          The fault codes for the Spot instance request, if any.

          • Code (string) --

            The reason code for the Spot instance state change.

          • Message (string) --

            The message for the Spot instance state change.

        • InstanceId (string) --

          The instance ID, if an instance has been launched to fulfill the Spot instance request.

        • LaunchGroup (string) --

          The instance launch group. Launch groups are Spot instances that launch together and terminate together.

        • LaunchSpecification (dict) --

          Additional information for launching instances.

          • UserData (string) --

            The user data to make available to the instances. 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.

          • SecurityGroups (list) --

            One or more security groups. When requesting instances in a VPC, you must specify the IDs of the security groups. When requesting instances in EC2-Classic, you can specify the names or the IDs of the security groups.

            • (dict) --

              Describes a security group.

              • GroupName (string) --

                The name of the security group.

              • GroupId (string) --

                The ID of the security group.

          • AddressingType (string) --

            Deprecated.

          • BlockDeviceMappings (list) --

            One or more block device mapping entries.

            • (dict) --

              Describes a block device mapping.

              • DeviceName (string) --

                The device name (for example, /dev/sdh or xvdh ).

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

              • Ebs (dict) --

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

                • Encrypted (boolean) --

                  Indicates whether the EBS volume is encrypted. Encrypted volumes can only be attached to instances that support Amazon EBS encryption. If you are creating a volume from a snapshot, you can't specify an encryption value. This is because only blank volumes can be encrypted on creation.

                • DeleteOnTermination (boolean) --

                  Indicates whether the EBS volume is deleted on instance termination.

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

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

                • VolumeType (string) --

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

                  Default: standard

              • NoDevice (string) --

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

          • 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 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

          • IamInstanceProfile (dict) --

            The IAM instance profile.

            • Arn (string) --

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

            • Name (string) --

              The name of the instance profile.

          • ImageId (string) --

            The ID of the AMI.

          • InstanceType (string) --

            The instance type.

          • KernelId (string) --

            The ID of the kernel.

          • KeyName (string) --

            The name of the key pair.

          • NetworkInterfaces (list) --

            One or more network interfaces. If you specify a network interface, you must specify subnet IDs and security group IDs using the network interface.

            • (dict) --

              Describes a network interface.

              • AssociatePublicIpAddress (boolean) --

                Indicates whether to assign a public IPv4 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 .

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

              • Description (string) --

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

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

              • Groups (list) --

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

                • (string) --

              • Ipv6AddressCount (integer) --

                A number of IPv6 addresses to assign to the network interface. Amazon EC2 chooses the IPv6 addresses from the range of the subnet. You cannot specify this option and the option to assign specific IPv6 addresses in the same request. You can specify this option if you've specified a minimum number of instances to launch.

              • Ipv6Addresses (list) --

                One or more IPv6 addresses to assign to the network interface. You cannot specify this option and the option to assign a number of IPv6 addresses in the same request. You cannot specify this option if you've specified a minimum number of instances to launch.

                • (dict) --

                  Describes an IPv6 address.

                  • Ipv6Address (string) --

                    The IPv6 address.

              • NetworkInterfaceId (string) --

                The ID of the network interface.

              • PrivateIpAddress (string) --

                The private IPv4 address of the network interface. Applies only if creating a network interface when launching an instance. You cannot specify this option if you're launching more than one instance in a RunInstances request.

              • PrivateIpAddresses (list) --

                One or more private IPv4 addresses to assign to the network interface. Only one private IPv4 address can be designated as primary. You cannot specify this option if you're launching more than one instance in a RunInstances request.

                • (dict) --

                  Describes a secondary private IPv4 address for a network interface.

                  • Primary (boolean) --

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

                  • PrivateIpAddress (string) --

                    The private IPv4 addresses.

              • SecondaryPrivateIpAddressCount (integer) --

                The number of secondary private IPv4 addresses. You can't specify this option and specify more than one private IP address using the private IP addresses option. You cannot specify this option if you're launching more than one instance in a RunInstances request.

              • SubnetId (string) --

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

          • Placement (dict) --

            The placement information for the instance.

            • AvailabilityZone (string) --

              The Availability Zone.

              [Spot fleet only] To specify multiple Availability Zones, separate them using commas; for example, "us-west-2a, us-west-2b".

            • GroupName (string) --

              The name of the placement group (for cluster 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 Spot instances.

          • RamdiskId (string) --

            The ID of the RAM disk.

          • SubnetId (string) --

            The ID of the subnet in which to launch the instance.

          • Monitoring (dict) --

            Describes the monitoring of an instance.

            • Enabled (boolean) --

              Indicates whether detailed monitoring is enabled. Otherwise, basic monitoring is enabled.

        • LaunchedAvailabilityZone (string) --

          The Availability Zone in which the bid is launched.

        • ProductDescription (string) --

          The product description associated with the Spot instance.

        • SpotInstanceRequestId (string) --

          The ID of the Spot instance request.

        • SpotPrice (string) --

          The maximum hourly price (bid) for the Spot instance launched to fulfill the request.

        • State (string) --

          The state of the Spot instance request. Spot bid status information can help you track your Spot instance requests. For more information, see Spot Bid Status in the Amazon Elastic Compute Cloud User Guide .

        • Status (dict) --

          The status code and status message describing the Spot instance request.

          • Code (string) --

            The status code. For a list of status codes, see Spot Bid Status Codes in the Amazon Elastic Compute Cloud User Guide .

          • Message (string) --

            The description for the status code.

          • UpdateTime (datetime) --

            The date and time of the most recent status update, in UTC format (for example, YYYY -MM -DD T*HH* :MM :SS Z).

        • Tags (list) --

          Any tags assigned to the resource.

          • (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.

        • Type (string) --

          The Spot instance request type.

        • ValidFrom (datetime) --

          The start date of the request, in UTC format (for example, YYYY -MM -DD T*HH* :MM :SS Z). The request becomes active at this date and time.

        • ValidUntil (datetime) --

          The end date of the request, in UTC format (for example, YYYY -MM -DD T*HH* :MM :SS Z). If this is a one-time request, it remains active until all instances launch, the request is canceled, or this date is reached. If the request is persistent, it remains active until it is canceled or this date is reached.

        • InstanceInterruptionBehavior (string) --

          Indicates whether a Spot instance stops or terminates when it is interrupted.

DescribeSpotPriceHistory (updated) Link ¶
Changes (request, response)
Request
{'InstanceTypes': {'x1e.16xlarge',
                   'x1e.2xlarge',
                   'x1e.4xlarge',
                   'x1e.8xlarge',
                   'x1e.xlarge'}}
Response
{'SpotPriceHistory': {'InstanceType': {'x1e.16xlarge',
                                       'x1e.2xlarge',
                                       'x1e.4xlarge',
                                       'x1e.8xlarge',
                                       'x1e.xlarge'}}}

Describes the Spot price history. For more information, see Spot Instance Pricing History in the Amazon Elastic Compute Cloud User Guide .

When you specify a start and end time, this operation returns the prices of the instance types within the time range that you specified and the time when the price changed. The price is valid within the time period that you specified; the response merely indicates the last time that the price changed.

See also: AWS API Documentation

Request Syntax

client.describe_spot_price_history(
    Filters=[
        {
            'Name': 'string',
            'Values': [
                'string',
            ]
        },
    ],
    AvailabilityZone='string',
    DryRun=True|False,
    EndTime=datetime(2015, 1, 1),
    InstanceTypes=[
        't1.micro'|'t2.nano'|'t2.micro'|'t2.small'|'t2.medium'|'t2.large'|'t2.xlarge'|'t2.2xlarge'|'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'|'m4.16xlarge'|'m2.xlarge'|'m2.2xlarge'|'m2.4xlarge'|'cr1.8xlarge'|'r3.large'|'r3.xlarge'|'r3.2xlarge'|'r3.4xlarge'|'r3.8xlarge'|'r4.large'|'r4.xlarge'|'r4.2xlarge'|'r4.4xlarge'|'r4.8xlarge'|'r4.16xlarge'|'x1.16xlarge'|'x1.32xlarge'|'x1e.xlarge'|'x1e.2xlarge'|'x1e.4xlarge'|'x1e.8xlarge'|'x1e.16xlarge'|'x1e.32xlarge'|'i2.xlarge'|'i2.2xlarge'|'i2.4xlarge'|'i2.8xlarge'|'i3.large'|'i3.xlarge'|'i3.2xlarge'|'i3.4xlarge'|'i3.8xlarge'|'i3.16xlarge'|'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'|'c5.large'|'c5.xlarge'|'c5.2xlarge'|'c5.4xlarge'|'c5.9xlarge'|'c5.18xlarge'|'cc1.4xlarge'|'cc2.8xlarge'|'g2.2xlarge'|'g2.8xlarge'|'g3.4xlarge'|'g3.8xlarge'|'g3.16xlarge'|'cg1.4xlarge'|'p2.xlarge'|'p2.8xlarge'|'p2.16xlarge'|'p3.2xlarge'|'p3.8xlarge'|'p3.16xlarge'|'d2.xlarge'|'d2.2xlarge'|'d2.4xlarge'|'d2.8xlarge'|'f1.2xlarge'|'f1.16xlarge',
    ],
    MaxResults=123,
    NextToken='string',
    ProductDescriptions=[
        'string',
    ],
    StartTime=datetime(2015, 1, 1)
)
type Filters

list

param Filters

One or more filters.

  • availability-zone - The Availability Zone for which prices should be returned.

  • instance-type - The type of instance (for example, m3.medium ).

  • product-description - The product description for the Spot price ( Linux/UNIX | SUSE Linux | Windows | Linux/UNIX (Amazon VPC) | SUSE Linux (Amazon VPC) | Windows (Amazon VPC) ).

  • spot-price - The Spot price. The value must match exactly (or use wildcards; greater than or less than comparison is not supported).

  • timestamp - The timestamp of the Spot price history, in UTC format (for example, YYYY -MM -DD T*HH* :MM :SS Z). You can use wildcards (* and ?). Greater than or less than comparison is not supported.

  • (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 AvailabilityZone

string

param AvailabilityZone

Filters the results by the specified Availability Zone.

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 EndTime

datetime

param EndTime

The date and time, up to the current date, from which to stop retrieving the price history data, in UTC format (for example, YYYY -MM -DD T*HH* :MM :SS Z).

type InstanceTypes

list

param InstanceTypes

Filters the results by the specified instance types. Note that T2 and HS1 instance types are not supported.

  • (string) --

type MaxResults

integer

param MaxResults

The maximum number of results to return in a single call. Specify a value between 1 and 1000. The default value is 1000. To retrieve the remaining results, make another call with the returned NextToken value.

type NextToken

string

param NextToken

The token for the next set of results.

type ProductDescriptions

list

param ProductDescriptions

Filters the results by the specified basic product descriptions.

  • (string) --

type StartTime

datetime

param StartTime

The date and time, up to the past 90 days, from which to start retrieving the price history data, in UTC format (for example, YYYY -MM -DD T*HH* :MM :SS Z).

rtype

dict

returns

Response Syntax

{
    'NextToken': 'string',
    'SpotPriceHistory': [
        {
            'AvailabilityZone': 'string',
            'InstanceType': 't1.micro'|'t2.nano'|'t2.micro'|'t2.small'|'t2.medium'|'t2.large'|'t2.xlarge'|'t2.2xlarge'|'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'|'m4.16xlarge'|'m2.xlarge'|'m2.2xlarge'|'m2.4xlarge'|'cr1.8xlarge'|'r3.large'|'r3.xlarge'|'r3.2xlarge'|'r3.4xlarge'|'r3.8xlarge'|'r4.large'|'r4.xlarge'|'r4.2xlarge'|'r4.4xlarge'|'r4.8xlarge'|'r4.16xlarge'|'x1.16xlarge'|'x1.32xlarge'|'x1e.xlarge'|'x1e.2xlarge'|'x1e.4xlarge'|'x1e.8xlarge'|'x1e.16xlarge'|'x1e.32xlarge'|'i2.xlarge'|'i2.2xlarge'|'i2.4xlarge'|'i2.8xlarge'|'i3.large'|'i3.xlarge'|'i3.2xlarge'|'i3.4xlarge'|'i3.8xlarge'|'i3.16xlarge'|'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'|'c5.large'|'c5.xlarge'|'c5.2xlarge'|'c5.4xlarge'|'c5.9xlarge'|'c5.18xlarge'|'cc1.4xlarge'|'cc2.8xlarge'|'g2.2xlarge'|'g2.8xlarge'|'g3.4xlarge'|'g3.8xlarge'|'g3.16xlarge'|'cg1.4xlarge'|'p2.xlarge'|'p2.8xlarge'|'p2.16xlarge'|'p3.2xlarge'|'p3.8xlarge'|'p3.16xlarge'|'d2.xlarge'|'d2.2xlarge'|'d2.4xlarge'|'d2.8xlarge'|'f1.2xlarge'|'f1.16xlarge',
            'ProductDescription': 'Linux/UNIX'|'Linux/UNIX (Amazon VPC)'|'Windows'|'Windows (Amazon VPC)',
            'SpotPrice': 'string',
            'Timestamp': datetime(2015, 1, 1)
        },
    ]
}

Response Structure

  • (dict) --

    Contains the output of DescribeSpotPriceHistory.

    • NextToken (string) --

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

    • SpotPriceHistory (list) --

      The historical Spot prices.

      • (dict) --

        Describes the maximum hourly price (bid) for any Spot instance launched to fulfill the request.

        • AvailabilityZone (string) --

          The Availability Zone.

        • InstanceType (string) --

          The instance type. Note that T2 and HS1 instance types are not supported.

        • ProductDescription (string) --

          A general description of the AMI.

        • SpotPrice (string) --

          The maximum price (bid) that you are willing to pay for a Spot instance.

        • Timestamp (datetime) --

          The date and time the request was created, in UTC format (for example, YYYY -MM -DD T*HH* :MM :SS Z).

ImportInstance (updated) Link ¶
Changes (request)
{'LaunchSpecification': {'InstanceType': {'x1e.16xlarge',
                                          'x1e.2xlarge',
                                          'x1e.4xlarge',
                                          'x1e.8xlarge',
                                          'x1e.xlarge'}}}

Creates an import instance task using metadata from the specified disk image. ImportInstance only supports single-volume VMs. To import multi-volume VMs, use ImportImage. For more information, see Importing a Virtual Machine Using the Amazon EC2 CLI.

For information about the import manifest referenced by this API action, see VM Import Manifest.

See also: AWS API Documentation

Request Syntax

client.import_instance(
    Description='string',
    DiskImages=[
        {
            'Description': 'string',
            'Image': {
                'Bytes': 123,
                'Format': 'VMDK'|'RAW'|'VHD',
                'ImportManifestUrl': 'string'
            },
            'Volume': {
                'Size': 123
            }
        },
    ],
    DryRun=True|False,
    LaunchSpecification={
        'AdditionalInfo': 'string',
        'Architecture': 'i386'|'x86_64',
        'GroupIds': [
            'string',
        ],
        'GroupNames': [
            'string',
        ],
        'InstanceInitiatedShutdownBehavior': 'stop'|'terminate',
        'InstanceType': 't1.micro'|'t2.nano'|'t2.micro'|'t2.small'|'t2.medium'|'t2.large'|'t2.xlarge'|'t2.2xlarge'|'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'|'m4.16xlarge'|'m2.xlarge'|'m2.2xlarge'|'m2.4xlarge'|'cr1.8xlarge'|'r3.large'|'r3.xlarge'|'r3.2xlarge'|'r3.4xlarge'|'r3.8xlarge'|'r4.large'|'r4.xlarge'|'r4.2xlarge'|'r4.4xlarge'|'r4.8xlarge'|'r4.16xlarge'|'x1.16xlarge'|'x1.32xlarge'|'x1e.xlarge'|'x1e.2xlarge'|'x1e.4xlarge'|'x1e.8xlarge'|'x1e.16xlarge'|'x1e.32xlarge'|'i2.xlarge'|'i2.2xlarge'|'i2.4xlarge'|'i2.8xlarge'|'i3.large'|'i3.xlarge'|'i3.2xlarge'|'i3.4xlarge'|'i3.8xlarge'|'i3.16xlarge'|'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'|'c5.large'|'c5.xlarge'|'c5.2xlarge'|'c5.4xlarge'|'c5.9xlarge'|'c5.18xlarge'|'cc1.4xlarge'|'cc2.8xlarge'|'g2.2xlarge'|'g2.8xlarge'|'g3.4xlarge'|'g3.8xlarge'|'g3.16xlarge'|'cg1.4xlarge'|'p2.xlarge'|'p2.8xlarge'|'p2.16xlarge'|'p3.2xlarge'|'p3.8xlarge'|'p3.16xlarge'|'d2.xlarge'|'d2.2xlarge'|'d2.4xlarge'|'d2.8xlarge'|'f1.2xlarge'|'f1.16xlarge',
        'Monitoring': True|False,
        'Placement': {
            'AvailabilityZone': 'string',
            'Affinity': 'string',
            'GroupName': 'string',
            'HostId': 'string',
            'Tenancy': 'default'|'dedicated'|'host',
            'SpreadDomain': 'string'
        },
        'PrivateIpAddress': 'string',
        'SubnetId': 'string',
        'UserData': {
            'Data': 'string'
        }
    },
    Platform='Windows'
)
type Description

string

param Description

A description for the instance being imported.

type DiskImages

list

param DiskImages

The disk image.

  • (dict) --

    Describes a disk image.

    • Description (string) --

      A description of the disk image.

    • Image (dict) --

      Information about the disk image.

      • Bytes (integer) -- [REQUIRED]

        The size of the disk image, in GiB.

      • Format (string) -- [REQUIRED]

        The disk image format.

      • ImportManifestUrl (string) -- [REQUIRED]

        A presigned URL for the import manifest stored in Amazon S3 and presented here as an Amazon S3 presigned URL. For information about creating a presigned URL for an Amazon S3 object, read the "Query String Request Authentication Alternative" section of the Authenticating REST Requests topic in the Amazon Simple Storage Service Developer Guide .

        For information about the import manifest referenced by this API action, see VM Import Manifest.

    • Volume (dict) --

      Information about the volume.

      • Size (integer) -- [REQUIRED]

        The size of the volume, in GiB.

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 LaunchSpecification

dict

param LaunchSpecification

The launch specification.

  • AdditionalInfo (string) --

    Reserved.

  • Architecture (string) --

    The architecture of the instance.

  • GroupIds (list) --

    One or more security group IDs.

    • (string) --

  • GroupNames (list) --

    One or more security group names.

    • (string) --

  • InstanceInitiatedShutdownBehavior (string) --

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

  • InstanceType (string) --

    The instance type. For more information about the instance types that you can import, see Instance Types in the VM Import/Export User Guide.

  • Monitoring (boolean) --

    Indicates whether monitoring is enabled.

  • Placement (dict) --

    The placement information for the instance.

    • AvailabilityZone (string) --

      The Availability Zone of the instance.

    • Affinity (string) --

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

    • GroupName (string) --

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

    • HostId (string) --

      The ID of the Dedicated Host on which the instance resides. This parameter is not supported for the ImportInstance command.

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

    • SpreadDomain (string) --

      Reserved for future use.

  • PrivateIpAddress (string) --

    [EC2-VPC] An available IP address from the IP address range of the subnet.

  • SubnetId (string) --

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

  • UserData (dict) --

    The user data to make available to the instance. 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.

    • Data (string) --

      The user data. 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 Platform

string

param Platform

[REQUIRED]

The instance operating system.

rtype

dict

returns

Response Syntax

{
    'ConversionTask': {
        'ConversionTaskId': 'string',
        'ExpirationTime': 'string',
        'ImportInstance': {
            'Description': 'string',
            'InstanceId': 'string',
            'Platform': 'Windows',
            'Volumes': [
                {
                    'AvailabilityZone': 'string',
                    'BytesConverted': 123,
                    'Description': 'string',
                    'Image': {
                        'Checksum': 'string',
                        'Format': 'VMDK'|'RAW'|'VHD',
                        'ImportManifestUrl': 'string',
                        'Size': 123
                    },
                    'Status': 'string',
                    'StatusMessage': 'string',
                    'Volume': {
                        'Id': 'string',
                        'Size': 123
                    }
                },
            ]
        },
        'ImportVolume': {
            'AvailabilityZone': 'string',
            'BytesConverted': 123,
            'Description': 'string',
            'Image': {
                'Checksum': 'string',
                'Format': 'VMDK'|'RAW'|'VHD',
                'ImportManifestUrl': 'string',
                'Size': 123
            },
            'Volume': {
                'Id': 'string',
                'Size': 123
            }
        },
        'State': 'active'|'cancelling'|'cancelled'|'completed',
        'StatusMessage': 'string',
        'Tags': [
            {
                'Key': 'string',
                'Value': 'string'
            },
        ]
    }
}

Response Structure

  • (dict) --

    Contains the output for ImportInstance.

    • ConversionTask (dict) --

      Information about the conversion task.

      • ConversionTaskId (string) --

        The ID of the conversion task.

      • ExpirationTime (string) --

        The time when the task expires. If the upload isn't complete before the expiration time, we automatically cancel the task.

      • ImportInstance (dict) --

        If the task is for importing an instance, this contains information about the import instance task.

        • Description (string) --

          A description of the task.

        • InstanceId (string) --

          The ID of the instance.

        • Platform (string) --

          The instance operating system.

        • Volumes (list) --

          One or more volumes.

          • (dict) --

            Describes an import volume task.

            • AvailabilityZone (string) --

              The Availability Zone where the resulting instance will reside.

            • BytesConverted (integer) --

              The number of bytes converted so far.

            • Description (string) --

              A description of the task.

            • Image (dict) --

              The image.

              • Checksum (string) --

                The checksum computed for the disk image.

              • Format (string) --

                The disk image format.

              • ImportManifestUrl (string) --

                A presigned URL for the import manifest stored in Amazon S3. For information about creating a presigned URL for an Amazon S3 object, read the "Query String Request Authentication Alternative" section of the Authenticating REST Requests topic in the Amazon Simple Storage Service Developer Guide .

                For information about the import manifest referenced by this API action, see VM Import Manifest.

              • Size (integer) --

                The size of the disk image, in GiB.

            • Status (string) --

              The status of the import of this particular disk image.

            • StatusMessage (string) --

              The status information or errors related to the disk image.

            • Volume (dict) --

              The volume.

              • Id (string) --

                The volume identifier.

              • Size (integer) --

                The size of the volume, in GiB.

      • ImportVolume (dict) --

        If the task is for importing a volume, this contains information about the import volume task.

        • AvailabilityZone (string) --

          The Availability Zone where the resulting volume will reside.

        • BytesConverted (integer) --

          The number of bytes converted so far.

        • Description (string) --

          The description you provided when starting the import volume task.

        • Image (dict) --

          The image.

          • Checksum (string) --

            The checksum computed for the disk image.

          • Format (string) --

            The disk image format.

          • ImportManifestUrl (string) --

            A presigned URL for the import manifest stored in Amazon S3. For information about creating a presigned URL for an Amazon S3 object, read the "Query String Request Authentication Alternative" section of the Authenticating REST Requests topic in the Amazon Simple Storage Service Developer Guide .

            For information about the import manifest referenced by this API action, see VM Import Manifest.

          • Size (integer) --

            The size of the disk image, in GiB.

        • Volume (dict) --

          The volume.

          • Id (string) --

            The volume identifier.

          • Size (integer) --

            The size of the volume, in GiB.

      • State (string) --

        The state of the conversion task.

      • StatusMessage (string) --

        The status message related to the conversion task.

      • Tags (list) --

        Any tags assigned to the task.

        • (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.

ModifyReservedInstances (updated) Link ¶
Changes (request)
{'TargetConfigurations': {'InstanceType': {'x1e.16xlarge',
                                           'x1e.2xlarge',
                                           'x1e.4xlarge',
                                           'x1e.8xlarge',
                                           'x1e.xlarge'}}}

Modifies the Availability Zone, instance count, instance type, or network platform (EC2-Classic or EC2-VPC) of your Reserved Instances. The Reserved Instances to be modified must be identical, except for Availability Zone, network platform, and instance type.

For more information, see Modifying Reserved Instances in the Amazon Elastic Compute Cloud User Guide.

See also: AWS API Documentation

Request Syntax

client.modify_reserved_instances(
    ReservedInstancesIds=[
        'string',
    ],
    ClientToken='string',
    TargetConfigurations=[
        {
            'AvailabilityZone': 'string',
            'InstanceCount': 123,
            'InstanceType': 't1.micro'|'t2.nano'|'t2.micro'|'t2.small'|'t2.medium'|'t2.large'|'t2.xlarge'|'t2.2xlarge'|'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'|'m4.16xlarge'|'m2.xlarge'|'m2.2xlarge'|'m2.4xlarge'|'cr1.8xlarge'|'r3.large'|'r3.xlarge'|'r3.2xlarge'|'r3.4xlarge'|'r3.8xlarge'|'r4.large'|'r4.xlarge'|'r4.2xlarge'|'r4.4xlarge'|'r4.8xlarge'|'r4.16xlarge'|'x1.16xlarge'|'x1.32xlarge'|'x1e.xlarge'|'x1e.2xlarge'|'x1e.4xlarge'|'x1e.8xlarge'|'x1e.16xlarge'|'x1e.32xlarge'|'i2.xlarge'|'i2.2xlarge'|'i2.4xlarge'|'i2.8xlarge'|'i3.large'|'i3.xlarge'|'i3.2xlarge'|'i3.4xlarge'|'i3.8xlarge'|'i3.16xlarge'|'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'|'c5.large'|'c5.xlarge'|'c5.2xlarge'|'c5.4xlarge'|'c5.9xlarge'|'c5.18xlarge'|'cc1.4xlarge'|'cc2.8xlarge'|'g2.2xlarge'|'g2.8xlarge'|'g3.4xlarge'|'g3.8xlarge'|'g3.16xlarge'|'cg1.4xlarge'|'p2.xlarge'|'p2.8xlarge'|'p2.16xlarge'|'p3.2xlarge'|'p3.8xlarge'|'p3.16xlarge'|'d2.xlarge'|'d2.2xlarge'|'d2.4xlarge'|'d2.8xlarge'|'f1.2xlarge'|'f1.16xlarge',
            'Platform': 'string',
            'Scope': 'Availability Zone'|'Region'
        },
    ]
)
type ReservedInstancesIds

list

param ReservedInstancesIds

[REQUIRED]

The IDs of the Reserved Instances to modify.

  • (string) --

type ClientToken

string

param ClientToken

A unique, case-sensitive token you provide to ensure idempotency of your modification request. For more information, see Ensuring Idempotency.

type TargetConfigurations

list

param TargetConfigurations

[REQUIRED]

The configuration settings for the Reserved Instances to modify.

  • (dict) --

    Describes the configuration settings for the modified Reserved Instances.

    • AvailabilityZone (string) --

      The Availability Zone for the modified Reserved Instances.

    • InstanceCount (integer) --

      The number of modified Reserved Instances.

    • InstanceType (string) --

      The instance type for the modified Reserved Instances.

    • Platform (string) --

      The network platform of the modified Reserved Instances, which is either EC2-Classic or EC2-VPC.

    • Scope (string) --

      Whether the Reserved Instance is applied to instances in a region or instances in a specific Availability Zone.

rtype

dict

returns

Response Syntax

{
    'ReservedInstancesModificationId': 'string'
}

Response Structure

  • (dict) --

    Contains the output of ModifyReservedInstances.

    • ReservedInstancesModificationId (string) --

      The ID for the modification.

RequestSpotFleet (updated) Link ¶
Changes (request)
{'SpotFleetRequestConfig': {'LaunchSpecifications': {'InstanceType': {'x1e.16xlarge',
                                                                      'x1e.2xlarge',
                                                                      'x1e.4xlarge',
                                                                      'x1e.8xlarge',
                                                                      'x1e.xlarge'}}}}

Creates a Spot fleet request.

You can submit a single request that includes multiple launch specifications that vary by instance type, AMI, Availability Zone, or subnet.

By default, the Spot fleet requests Spot instances in the Spot pool where the price per unit is the lowest. Each launch specification can include its own instance weighting that reflects the value of the instance type to your application workload.

Alternatively, you can specify that the Spot fleet distribute the target capacity across the Spot pools included in its launch specifications. By ensuring that the Spot instances in your Spot fleet are in different Spot pools, you can improve the availability of your fleet.

For more information, see Spot Fleet Requests in the Amazon Elastic Compute Cloud User Guide .

See also: AWS API Documentation

Request Syntax

client.request_spot_fleet(
    DryRun=True|False,
    SpotFleetRequestConfig={
        'AllocationStrategy': 'lowestPrice'|'diversified',
        'ClientToken': 'string',
        'ExcessCapacityTerminationPolicy': 'noTermination'|'default',
        'FulfilledCapacity': 123.0,
        'IamFleetRole': 'string',
        'LaunchSpecifications': [
            {
                'SecurityGroups': [
                    {
                        'GroupName': 'string',
                        'GroupId': 'string'
                    },
                ],
                'AddressingType': 'string',
                'BlockDeviceMappings': [
                    {
                        'DeviceName': 'string',
                        'VirtualName': 'string',
                        'Ebs': {
                            'Encrypted': True|False,
                            'DeleteOnTermination': True|False,
                            'Iops': 123,
                            'SnapshotId': 'string',
                            'VolumeSize': 123,
                            'VolumeType': 'standard'|'io1'|'gp2'|'sc1'|'st1'
                        },
                        'NoDevice': 'string'
                    },
                ],
                'EbsOptimized': True|False,
                'IamInstanceProfile': {
                    'Arn': 'string',
                    'Name': 'string'
                },
                'ImageId': 'string',
                'InstanceType': 't1.micro'|'t2.nano'|'t2.micro'|'t2.small'|'t2.medium'|'t2.large'|'t2.xlarge'|'t2.2xlarge'|'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'|'m4.16xlarge'|'m2.xlarge'|'m2.2xlarge'|'m2.4xlarge'|'cr1.8xlarge'|'r3.large'|'r3.xlarge'|'r3.2xlarge'|'r3.4xlarge'|'r3.8xlarge'|'r4.large'|'r4.xlarge'|'r4.2xlarge'|'r4.4xlarge'|'r4.8xlarge'|'r4.16xlarge'|'x1.16xlarge'|'x1.32xlarge'|'x1e.xlarge'|'x1e.2xlarge'|'x1e.4xlarge'|'x1e.8xlarge'|'x1e.16xlarge'|'x1e.32xlarge'|'i2.xlarge'|'i2.2xlarge'|'i2.4xlarge'|'i2.8xlarge'|'i3.large'|'i3.xlarge'|'i3.2xlarge'|'i3.4xlarge'|'i3.8xlarge'|'i3.16xlarge'|'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'|'c5.large'|'c5.xlarge'|'c5.2xlarge'|'c5.4xlarge'|'c5.9xlarge'|'c5.18xlarge'|'cc1.4xlarge'|'cc2.8xlarge'|'g2.2xlarge'|'g2.8xlarge'|'g3.4xlarge'|'g3.8xlarge'|'g3.16xlarge'|'cg1.4xlarge'|'p2.xlarge'|'p2.8xlarge'|'p2.16xlarge'|'p3.2xlarge'|'p3.8xlarge'|'p3.16xlarge'|'d2.xlarge'|'d2.2xlarge'|'d2.4xlarge'|'d2.8xlarge'|'f1.2xlarge'|'f1.16xlarge',
                'KernelId': 'string',
                'KeyName': 'string',
                'Monitoring': {
                    'Enabled': True|False
                },
                'NetworkInterfaces': [
                    {
                        'AssociatePublicIpAddress': True|False,
                        'DeleteOnTermination': True|False,
                        'Description': 'string',
                        'DeviceIndex': 123,
                        'Groups': [
                            'string',
                        ],
                        'Ipv6AddressCount': 123,
                        'Ipv6Addresses': [
                            {
                                'Ipv6Address': 'string'
                            },
                        ],
                        'NetworkInterfaceId': 'string',
                        'PrivateIpAddress': 'string',
                        'PrivateIpAddresses': [
                            {
                                'Primary': True|False,
                                'PrivateIpAddress': 'string'
                            },
                        ],
                        'SecondaryPrivateIpAddressCount': 123,
                        'SubnetId': 'string'
                    },
                ],
                'Placement': {
                    'AvailabilityZone': 'string',
                    'GroupName': 'string',
                    'Tenancy': 'default'|'dedicated'|'host'
                },
                'RamdiskId': 'string',
                'SpotPrice': 'string',
                'SubnetId': 'string',
                'UserData': 'string',
                'WeightedCapacity': 123.0,
                'TagSpecifications': [
                    {
                        'ResourceType': 'customer-gateway'|'dhcp-options'|'image'|'instance'|'internet-gateway'|'network-acl'|'network-interface'|'reserved-instances'|'route-table'|'snapshot'|'spot-instances-request'|'subnet'|'security-group'|'volume'|'vpc'|'vpn-connection'|'vpn-gateway',
                        'Tags': [
                            {
                                'Key': 'string',
                                'Value': 'string'
                            },
                        ]
                    },
                ]
            },
        ],
        'SpotPrice': 'string',
        'TargetCapacity': 123,
        'TerminateInstancesWithExpiration': True|False,
        'Type': 'request'|'maintain',
        'ValidFrom': datetime(2015, 1, 1),
        'ValidUntil': datetime(2015, 1, 1),
        'ReplaceUnhealthyInstances': True|False,
        'InstanceInterruptionBehavior': 'stop'|'terminate',
        'LoadBalancersConfig': {
            'ClassicLoadBalancersConfig': {
                'ClassicLoadBalancers': [
                    {
                        'Name': 'string'
                    },
                ]
            },
            'TargetGroupsConfig': {
                'TargetGroups': [
                    {
                        'Arn': '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 SpotFleetRequestConfig

dict

param SpotFleetRequestConfig

[REQUIRED]

The configuration for the Spot fleet request.

  • AllocationStrategy (string) --

    Indicates how to allocate the target capacity across the Spot pools specified by the Spot fleet request. The default is lowestPrice .

  • ClientToken (string) --

    A unique, case-sensitive identifier you provide to ensure idempotency of your listings. This helps avoid duplicate listings. For more information, see Ensuring Idempotency.

  • ExcessCapacityTerminationPolicy (string) --

    Indicates whether running Spot instances should be terminated if the target capacity of the Spot fleet request is decreased below the current size of the Spot fleet.

  • FulfilledCapacity (float) --

    The number of units fulfilled by this request compared to the set target capacity.

  • IamFleetRole (string) -- [REQUIRED]

    Grants the Spot fleet permission to terminate Spot instances on your behalf when you cancel its Spot fleet request using CancelSpotFleetRequests or when the Spot fleet request expires, if you set terminateInstancesWithExpiration .

  • LaunchSpecifications (list) -- [REQUIRED]

    Information about the launch specifications for the Spot fleet request.

    • (dict) --

      Describes the launch specification for one or more Spot instances.

      • SecurityGroups (list) --

        One or more security groups. When requesting instances in a VPC, you must specify the IDs of the security groups. When requesting instances in EC2-Classic, you can specify the names or the IDs of the security groups.

        • (dict) --

          Describes a security group.

          • GroupName (string) --

            The name of the security group.

          • GroupId (string) --

            The ID of the security group.

      • AddressingType (string) --

        Deprecated.

      • BlockDeviceMappings (list) --

        One or more block device mapping entries. You can't specify both a snapshot ID and an encryption value. This is because only blank volumes can be encrypted on creation. If a snapshot is the basis for a volume, it is not blank and its encryption status is used for the volume encryption status.

        • (dict) --

          Describes a block device mapping.

          • DeviceName (string) --

            The device name (for example, /dev/sdh or xvdh ).

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

          • Ebs (dict) --

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

            • Encrypted (boolean) --

              Indicates whether the EBS volume is encrypted. Encrypted volumes can only be attached to instances that support Amazon EBS encryption. If you are creating a volume from a snapshot, you can't specify an encryption value. This is because only blank volumes can be encrypted on creation.

            • DeleteOnTermination (boolean) --

              Indicates whether the EBS volume is deleted on instance termination.

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

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

            • VolumeType (string) --

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

              Default: standard

          • NoDevice (string) --

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

      • EbsOptimized (boolean) --

        Indicates whether the instances are 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

      • IamInstanceProfile (dict) --

        The IAM instance profile.

        • Arn (string) --

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

        • Name (string) --

          The name of the instance profile.

      • ImageId (string) --

        The ID of the AMI.

      • InstanceType (string) --

        The instance type. Note that T2 and HS1 instance types are not supported.

      • KernelId (string) --

        The ID of the kernel.

      • KeyName (string) --

        The name of the key pair.

      • Monitoring (dict) --

        Enable or disable monitoring for the instances.

        • Enabled (boolean) --

          Enables monitoring for the instance.

          Default: false

      • NetworkInterfaces (list) --

        One or more network interfaces. If you specify a network interface, you must specify subnet IDs and security group IDs using the network interface.

        • (dict) --

          Describes a network interface.

          • AssociatePublicIpAddress (boolean) --

            Indicates whether to assign a public IPv4 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 .

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

          • Description (string) --

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

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

          • Groups (list) --

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

            • (string) --

          • Ipv6AddressCount (integer) --

            A number of IPv6 addresses to assign to the network interface. Amazon EC2 chooses the IPv6 addresses from the range of the subnet. You cannot specify this option and the option to assign specific IPv6 addresses in the same request. You can specify this option if you've specified a minimum number of instances to launch.

          • Ipv6Addresses (list) --

            One or more IPv6 addresses to assign to the network interface. You cannot specify this option and the option to assign a number of IPv6 addresses in the same request. You cannot specify this option if you've specified a minimum number of instances to launch.

            • (dict) --

              Describes an IPv6 address.

              • Ipv6Address (string) --

                The IPv6 address.

          • NetworkInterfaceId (string) --

            The ID of the network interface.

          • PrivateIpAddress (string) --

            The private IPv4 address of the network interface. Applies only if creating a network interface when launching an instance. You cannot specify this option if you're launching more than one instance in a RunInstances request.

          • PrivateIpAddresses (list) --

            One or more private IPv4 addresses to assign to the network interface. Only one private IPv4 address can be designated as primary. You cannot specify this option if you're launching more than one instance in a RunInstances request.

            • (dict) --

              Describes a secondary private IPv4 address for a network interface.

              • Primary (boolean) --

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

              • PrivateIpAddress (string) -- [REQUIRED]

                The private IPv4 addresses.

          • SecondaryPrivateIpAddressCount (integer) --

            The number of secondary private IPv4 addresses. You can't specify this option and specify more than one private IP address using the private IP addresses option. You cannot specify this option if you're launching more than one instance in a RunInstances request.

          • SubnetId (string) --

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

      • Placement (dict) --

        The placement information.

        • AvailabilityZone (string) --

          The Availability Zone.

          [Spot fleet only] To specify multiple Availability Zones, separate them using commas; for example, "us-west-2a, us-west-2b".

        • GroupName (string) --

          The name of the placement group (for cluster 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 Spot instances.

      • RamdiskId (string) --

        The ID of the RAM disk.

      • SpotPrice (string) --

        The bid price per unit hour for the specified instance type. If this value is not specified, the default is the Spot bid price specified for the fleet. To determine the bid price per unit hour, divide the Spot bid price by the value of WeightedCapacity .

      • SubnetId (string) --

        The ID of the subnet in which to launch the instances. To specify multiple subnets, separate them using commas; for example, "subnet-a61dafcf, subnet-65ea5f08".

      • UserData (string) --

        The user data to make available to the instances. 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.

      • WeightedCapacity (float) --

        The number of units provided by the specified instance type. These are the same units that you chose to set the target capacity in terms (instances or a performance characteristic such as vCPUs, memory, or I/O).

        If the target capacity divided by this value is not a whole number, we round the number of instances to the next whole number. If this value is not specified, the default is 1.

      • TagSpecifications (list) --

        The tags to apply during creation.

        • (dict) --

          The tags for a Spot fleet resource.

          • ResourceType (string) --

            The type of resource. Currently, the only resource type that is supported is instance .

          • Tags (list) --

            The tags.

            • (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.

  • SpotPrice (string) -- [REQUIRED]

    The bid price per unit hour.

  • TargetCapacity (integer) -- [REQUIRED]

    The number of units to request. You can choose to set the target capacity in terms of instances or a performance characteristic that is important to your application workload, such as vCPUs, memory, or I/O.

  • TerminateInstancesWithExpiration (boolean) --

    Indicates whether running Spot instances should be terminated when the Spot fleet request expires.

  • Type (string) --

    The type of request. Indicates whether the fleet will only request the target capacity or also attempt to maintain it. When you request a certain target capacity, the fleet will only place the required bids. It will not attempt to replenish Spot instances if capacity is diminished, nor will it submit bids in alternative Spot pools if capacity is not available. When you want to maintain a certain target capacity, fleet will place the required bids to meet this target capacity. It will also automatically replenish any interrupted instances. Default: maintain .

  • ValidFrom (datetime) --

    The start date and time of the request, in UTC format (for example, YYYY -MM -DD T*HH* :MM :SS Z). The default is to start fulfilling the request immediately.

  • ValidUntil (datetime) --

    The end date and time of the request, in UTC format (for example, YYYY -MM -DD T*HH* :MM :SS Z). At this point, no new Spot instance requests are placed or enabled to fulfill the request.

  • ReplaceUnhealthyInstances (boolean) --

    Indicates whether Spot fleet should replace unhealthy instances.

  • InstanceInterruptionBehavior (string) --

    Indicates whether a Spot instance stops or terminates when it is interrupted.

  • LoadBalancersConfig (dict) --

    One or more Classic Load Balancers and target groups to attach to the Spot fleet request. Spot fleet registers the running Spot instances with the specified Classic Load Balancers and target groups.

    With Network Load Balancers, Spot fleet cannot register instances that have the following instance types: C1, CC1, CC2, CG1, CG2, CR1, CS1, G1, G2, HI1, HS1, M1, M2, M3, and T1.

    • ClassicLoadBalancersConfig (dict) --

      The Classic Load Balancers.

      • ClassicLoadBalancers (list) -- [REQUIRED]

        One or more Classic Load Balancers.

        • (dict) --

          Describes a Classic Load Balancer.

          • Name (string) -- [REQUIRED]

            The name of the load balancer.

    • TargetGroupsConfig (dict) --

      The target groups.

      • TargetGroups (list) -- [REQUIRED]

        One or more target groups.

        • (dict) --

          Describes a load balancer target group.

          • Arn (string) -- [REQUIRED]

            The Amazon Resource Name (ARN) of the target group.

rtype

dict

returns

Response Syntax

{
    'SpotFleetRequestId': 'string'
}

Response Structure

  • (dict) --

    Contains the output of RequestSpotFleet.

    • SpotFleetRequestId (string) --

      The ID of the Spot fleet request.

RequestSpotInstances (updated) Link ¶
Changes (request, response)
Request
{'LaunchSpecification': {'InstanceType': {'x1e.16xlarge',
                                          'x1e.2xlarge',
                                          'x1e.4xlarge',
                                          'x1e.8xlarge',
                                          'x1e.xlarge'}}}
Response
{'SpotInstanceRequests': {'LaunchSpecification': {'InstanceType': {'x1e.16xlarge',
                                                                   'x1e.2xlarge',
                                                                   'x1e.4xlarge',
                                                                   'x1e.8xlarge',
                                                                   'x1e.xlarge'}}}}

Creates a Spot instance request. Spot instances are instances that Amazon EC2 launches when the bid price that you specify exceeds the current Spot price. Amazon EC2 periodically sets the Spot price based on available Spot Instance capacity and current Spot instance requests. For more information, see Spot Instance Requests in the Amazon Elastic Compute Cloud User Guide .

See also: AWS API Documentation

Request Syntax

client.request_spot_instances(
    AvailabilityZoneGroup='string',
    BlockDurationMinutes=123,
    ClientToken='string',
    DryRun=True|False,
    InstanceCount=123,
    LaunchGroup='string',
    LaunchSpecification={
        'SecurityGroupIds': [
            'string',
        ],
        'SecurityGroups': [
            'string',
        ],
        'AddressingType': 'string',
        'BlockDeviceMappings': [
            {
                'DeviceName': 'string',
                'VirtualName': 'string',
                'Ebs': {
                    'Encrypted': True|False,
                    'DeleteOnTermination': True|False,
                    'Iops': 123,
                    'SnapshotId': 'string',
                    'VolumeSize': 123,
                    'VolumeType': 'standard'|'io1'|'gp2'|'sc1'|'st1'
                },
                'NoDevice': 'string'
            },
        ],
        'EbsOptimized': True|False,
        'IamInstanceProfile': {
            'Arn': 'string',
            'Name': 'string'
        },
        'ImageId': 'string',
        'InstanceType': 't1.micro'|'t2.nano'|'t2.micro'|'t2.small'|'t2.medium'|'t2.large'|'t2.xlarge'|'t2.2xlarge'|'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'|'m4.16xlarge'|'m2.xlarge'|'m2.2xlarge'|'m2.4xlarge'|'cr1.8xlarge'|'r3.large'|'r3.xlarge'|'r3.2xlarge'|'r3.4xlarge'|'r3.8xlarge'|'r4.large'|'r4.xlarge'|'r4.2xlarge'|'r4.4xlarge'|'r4.8xlarge'|'r4.16xlarge'|'x1.16xlarge'|'x1.32xlarge'|'x1e.xlarge'|'x1e.2xlarge'|'x1e.4xlarge'|'x1e.8xlarge'|'x1e.16xlarge'|'x1e.32xlarge'|'i2.xlarge'|'i2.2xlarge'|'i2.4xlarge'|'i2.8xlarge'|'i3.large'|'i3.xlarge'|'i3.2xlarge'|'i3.4xlarge'|'i3.8xlarge'|'i3.16xlarge'|'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'|'c5.large'|'c5.xlarge'|'c5.2xlarge'|'c5.4xlarge'|'c5.9xlarge'|'c5.18xlarge'|'cc1.4xlarge'|'cc2.8xlarge'|'g2.2xlarge'|'g2.8xlarge'|'g3.4xlarge'|'g3.8xlarge'|'g3.16xlarge'|'cg1.4xlarge'|'p2.xlarge'|'p2.8xlarge'|'p2.16xlarge'|'p3.2xlarge'|'p3.8xlarge'|'p3.16xlarge'|'d2.xlarge'|'d2.2xlarge'|'d2.4xlarge'|'d2.8xlarge'|'f1.2xlarge'|'f1.16xlarge',
        'KernelId': 'string',
        'KeyName': 'string',
        'Monitoring': {
            'Enabled': True|False
        },
        'NetworkInterfaces': [
            {
                'AssociatePublicIpAddress': True|False,
                'DeleteOnTermination': True|False,
                'Description': 'string',
                'DeviceIndex': 123,
                'Groups': [
                    'string',
                ],
                'Ipv6AddressCount': 123,
                'Ipv6Addresses': [
                    {
                        'Ipv6Address': 'string'
                    },
                ],
                'NetworkInterfaceId': 'string',
                'PrivateIpAddress': 'string',
                'PrivateIpAddresses': [
                    {
                        'Primary': True|False,
                        'PrivateIpAddress': 'string'
                    },
                ],
                'SecondaryPrivateIpAddressCount': 123,
                'SubnetId': 'string'
            },
        ],
        'Placement': {
            'AvailabilityZone': 'string',
            'GroupName': 'string',
            'Tenancy': 'default'|'dedicated'|'host'
        },
        'RamdiskId': 'string',
        'SubnetId': 'string',
        'UserData': 'string'
    },
    SpotPrice='string',
    Type='one-time'|'persistent',
    ValidFrom=datetime(2015, 1, 1),
    ValidUntil=datetime(2015, 1, 1),
    InstanceInterruptionBehavior='stop'|'terminate'
)
type AvailabilityZoneGroup

string

param AvailabilityZoneGroup

The user-specified name for a logical grouping of bids.

When you specify an Availability Zone group in a Spot Instance request, all Spot instances in the request are launched in the same Availability Zone. Instance proximity is maintained with this parameter, but the choice of Availability Zone is not. The group applies only to bids for Spot Instances of the same instance type. Any additional Spot instance requests that are specified with the same Availability Zone group name are launched in that same Availability Zone, as long as at least one instance from the group is still active.

If there is no active instance running in the Availability Zone group that you specify for a new Spot instance request (all instances are terminated, the bid is expired, or the bid falls below current market), then Amazon EC2 launches the instance in any Availability Zone where the constraint can be met. Consequently, the subsequent set of Spot instances could be placed in a different zone from the original request, even if you specified the same Availability Zone group.

Default: Instances are launched in any available Availability Zone.

type BlockDurationMinutes

integer

param BlockDurationMinutes

The required duration for the Spot instances (also known as Spot blocks), in minutes. This value must be a multiple of 60 (60, 120, 180, 240, 300, or 360).

The duration period starts as soon as your Spot instance receives its instance ID. At the end of the duration period, Amazon EC2 marks the Spot instance for termination and provides a Spot instance termination notice, which gives the instance a two-minute warning before it terminates.

Note that you can't specify an Availability Zone group or a launch group if you specify a duration.

type ClientToken

string

param ClientToken

Unique, case-sensitive identifier that you provide to ensure the idempotency of the request. For more information, see How to Ensure Idempotency in the Amazon Elastic Compute Cloud User Guide .

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 InstanceCount

integer

param InstanceCount

The maximum number of Spot instances to launch.

Default: 1

type LaunchGroup

string

param LaunchGroup

The instance launch group. Launch groups are Spot instances that launch together and terminate together.

Default: Instances are launched and terminated individually

type LaunchSpecification

dict

param LaunchSpecification

The launch specification.

  • SecurityGroupIds (list) --

    One or more security group IDs.

    • (string) --

  • SecurityGroups (list) --

    One or more security groups. When requesting instances in a VPC, you must specify the IDs of the security groups. When requesting instances in EC2-Classic, you can specify the names or the IDs of the security groups.

    • (string) --

  • AddressingType (string) --

    Deprecated.

  • BlockDeviceMappings (list) --

    One or more block device mapping entries. You can't specify both a snapshot ID and an encryption value. This is because only blank volumes can be encrypted on creation. If a snapshot is the basis for a volume, it is not blank and its encryption status is used for the volume encryption status.

    • (dict) --

      Describes a block device mapping.

      • DeviceName (string) --

        The device name (for example, /dev/sdh or xvdh ).

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

      • Ebs (dict) --

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

        • Encrypted (boolean) --

          Indicates whether the EBS volume is encrypted. Encrypted volumes can only be attached to instances that support Amazon EBS encryption. If you are creating a volume from a snapshot, you can't specify an encryption value. This is because only blank volumes can be encrypted on creation.

        • DeleteOnTermination (boolean) --

          Indicates whether the EBS volume is deleted on instance termination.

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

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

        • VolumeType (string) --

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

          Default: standard

      • NoDevice (string) --

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

  • 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 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

  • IamInstanceProfile (dict) --

    The IAM instance profile.

    • Arn (string) --

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

    • Name (string) --

      The name of the instance profile.

  • ImageId (string) --

    The ID of the AMI.

  • InstanceType (string) --

    The instance type.

  • KernelId (string) --

    The ID of the kernel.

  • KeyName (string) --

    The name of the key pair.

  • Monitoring (dict) --

    Indicates whether basic or detailed monitoring is enabled for the instance.

    Default: Disabled

    • Enabled (boolean) -- [REQUIRED]

      Indicates whether detailed monitoring is enabled. Otherwise, basic monitoring is enabled.

  • NetworkInterfaces (list) --

    One or more network interfaces. If you specify a network interface, you must specify subnet IDs and security group IDs using the network interface.

    • (dict) --

      Describes a network interface.

      • AssociatePublicIpAddress (boolean) --

        Indicates whether to assign a public IPv4 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 .

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

      • Description (string) --

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

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

      • Groups (list) --

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

        • (string) --

      • Ipv6AddressCount (integer) --

        A number of IPv6 addresses to assign to the network interface. Amazon EC2 chooses the IPv6 addresses from the range of the subnet. You cannot specify this option and the option to assign specific IPv6 addresses in the same request. You can specify this option if you've specified a minimum number of instances to launch.

      • Ipv6Addresses (list) --

        One or more IPv6 addresses to assign to the network interface. You cannot specify this option and the option to assign a number of IPv6 addresses in the same request. You cannot specify this option if you've specified a minimum number of instances to launch.

        • (dict) --

          Describes an IPv6 address.

          • Ipv6Address (string) --

            The IPv6 address.

      • NetworkInterfaceId (string) --

        The ID of the network interface.

      • PrivateIpAddress (string) --

        The private IPv4 address of the network interface. Applies only if creating a network interface when launching an instance. You cannot specify this option if you're launching more than one instance in a RunInstances request.

      • PrivateIpAddresses (list) --

        One or more private IPv4 addresses to assign to the network interface. Only one private IPv4 address can be designated as primary. You cannot specify this option if you're launching more than one instance in a RunInstances request.

        • (dict) --

          Describes a secondary private IPv4 address for a network interface.

          • Primary (boolean) --

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

          • PrivateIpAddress (string) -- [REQUIRED]

            The private IPv4 addresses.

      • SecondaryPrivateIpAddressCount (integer) --

        The number of secondary private IPv4 addresses. You can't specify this option and specify more than one private IP address using the private IP addresses option. You cannot specify this option if you're launching more than one instance in a RunInstances request.

      • SubnetId (string) --

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

  • Placement (dict) --

    The placement information for the instance.

    • AvailabilityZone (string) --

      The Availability Zone.

      [Spot fleet only] To specify multiple Availability Zones, separate them using commas; for example, "us-west-2a, us-west-2b".

    • GroupName (string) --

      The name of the placement group (for cluster 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 Spot instances.

  • RamdiskId (string) --

    The ID of the RAM disk.

  • SubnetId (string) --

    The ID of the subnet in which to launch the instance.

  • UserData (string) --

    The user data to make available to the instances. 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 SpotPrice

string

param SpotPrice

[REQUIRED]

The maximum hourly price (bid) for any Spot instance launched to fulfill the request.

type Type

string

param Type

The Spot instance request type.

Default: one-time

type ValidFrom

datetime

param ValidFrom

The start date of the request. If this is a one-time request, the request becomes active at this date and time and remains active until all instances launch, the request expires, or the request is canceled. If the request is persistent, the request becomes active at this date and time and remains active until it expires or is canceled.

Default: The request is effective indefinitely.

type ValidUntil

datetime

param ValidUntil

The end date of the request. If this is a one-time request, the request remains active until all instances launch, the request is canceled, or this date is reached. If the request is persistent, it remains active until it is canceled or this date and time is reached.

Default: The request is effective indefinitely.

type InstanceInterruptionBehavior

string

param InstanceInterruptionBehavior

Indicates whether a Spot instance stops or terminates when it is interrupted.

rtype

dict

returns

Response Syntax

{
    'SpotInstanceRequests': [
        {
            'ActualBlockHourlyPrice': 'string',
            'AvailabilityZoneGroup': 'string',
            'BlockDurationMinutes': 123,
            'CreateTime': datetime(2015, 1, 1),
            'Fault': {
                'Code': 'string',
                'Message': 'string'
            },
            'InstanceId': 'string',
            'LaunchGroup': 'string',
            'LaunchSpecification': {
                'UserData': 'string',
                'SecurityGroups': [
                    {
                        'GroupName': 'string',
                        'GroupId': 'string'
                    },
                ],
                'AddressingType': 'string',
                'BlockDeviceMappings': [
                    {
                        'DeviceName': 'string',
                        'VirtualName': 'string',
                        'Ebs': {
                            'Encrypted': True|False,
                            'DeleteOnTermination': True|False,
                            'Iops': 123,
                            'SnapshotId': 'string',
                            'VolumeSize': 123,
                            'VolumeType': 'standard'|'io1'|'gp2'|'sc1'|'st1'
                        },
                        'NoDevice': 'string'
                    },
                ],
                'EbsOptimized': True|False,
                'IamInstanceProfile': {
                    'Arn': 'string',
                    'Name': 'string'
                },
                'ImageId': 'string',
                'InstanceType': 't1.micro'|'t2.nano'|'t2.micro'|'t2.small'|'t2.medium'|'t2.large'|'t2.xlarge'|'t2.2xlarge'|'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'|'m4.16xlarge'|'m2.xlarge'|'m2.2xlarge'|'m2.4xlarge'|'cr1.8xlarge'|'r3.large'|'r3.xlarge'|'r3.2xlarge'|'r3.4xlarge'|'r3.8xlarge'|'r4.large'|'r4.xlarge'|'r4.2xlarge'|'r4.4xlarge'|'r4.8xlarge'|'r4.16xlarge'|'x1.16xlarge'|'x1.32xlarge'|'x1e.xlarge'|'x1e.2xlarge'|'x1e.4xlarge'|'x1e.8xlarge'|'x1e.16xlarge'|'x1e.32xlarge'|'i2.xlarge'|'i2.2xlarge'|'i2.4xlarge'|'i2.8xlarge'|'i3.large'|'i3.xlarge'|'i3.2xlarge'|'i3.4xlarge'|'i3.8xlarge'|'i3.16xlarge'|'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'|'c5.large'|'c5.xlarge'|'c5.2xlarge'|'c5.4xlarge'|'c5.9xlarge'|'c5.18xlarge'|'cc1.4xlarge'|'cc2.8xlarge'|'g2.2xlarge'|'g2.8xlarge'|'g3.4xlarge'|'g3.8xlarge'|'g3.16xlarge'|'cg1.4xlarge'|'p2.xlarge'|'p2.8xlarge'|'p2.16xlarge'|'p3.2xlarge'|'p3.8xlarge'|'p3.16xlarge'|'d2.xlarge'|'d2.2xlarge'|'d2.4xlarge'|'d2.8xlarge'|'f1.2xlarge'|'f1.16xlarge',
                'KernelId': 'string',
                'KeyName': 'string',
                'NetworkInterfaces': [
                    {
                        'AssociatePublicIpAddress': True|False,
                        'DeleteOnTermination': True|False,
                        'Description': 'string',
                        'DeviceIndex': 123,
                        'Groups': [
                            'string',
                        ],
                        'Ipv6AddressCount': 123,
                        'Ipv6Addresses': [
                            {
                                'Ipv6Address': 'string'
                            },
                        ],
                        'NetworkInterfaceId': 'string',
                        'PrivateIpAddress': 'string',
                        'PrivateIpAddresses': [
                            {
                                'Primary': True|False,
                                'PrivateIpAddress': 'string'
                            },
                        ],
                        'SecondaryPrivateIpAddressCount': 123,
                        'SubnetId': 'string'
                    },
                ],
                'Placement': {
                    'AvailabilityZone': 'string',
                    'GroupName': 'string',
                    'Tenancy': 'default'|'dedicated'|'host'
                },
                'RamdiskId': 'string',
                'SubnetId': 'string',
                'Monitoring': {
                    'Enabled': True|False
                }
            },
            'LaunchedAvailabilityZone': 'string',
            'ProductDescription': 'Linux/UNIX'|'Linux/UNIX (Amazon VPC)'|'Windows'|'Windows (Amazon VPC)',
            'SpotInstanceRequestId': 'string',
            'SpotPrice': 'string',
            'State': 'open'|'active'|'closed'|'cancelled'|'failed',
            'Status': {
                'Code': 'string',
                'Message': 'string',
                'UpdateTime': datetime(2015, 1, 1)
            },
            'Tags': [
                {
                    'Key': 'string',
                    'Value': 'string'
                },
            ],
            'Type': 'one-time'|'persistent',
            'ValidFrom': datetime(2015, 1, 1),
            'ValidUntil': datetime(2015, 1, 1),
            'InstanceInterruptionBehavior': 'stop'|'terminate'
        },
    ]
}

Response Structure

  • (dict) --

    Contains the output of RequestSpotInstances.

    • SpotInstanceRequests (list) --

      One or more Spot instance requests.

      • (dict) --

        Describes a Spot instance request.

        • ActualBlockHourlyPrice (string) --

          If you specified a duration and your Spot instance request was fulfilled, this is the fixed hourly price in effect for the Spot instance while it runs.

        • AvailabilityZoneGroup (string) --

          The Availability Zone group. If you specify the same Availability Zone group for all Spot instance requests, all Spot instances are launched in the same Availability Zone.

        • BlockDurationMinutes (integer) --

          The duration for the Spot instance, in minutes.

        • CreateTime (datetime) --

          The date and time when the Spot instance request was created, in UTC format (for example, YYYY -MM -DD T*HH* :MM :SS Z).

        • Fault (dict) --

          The fault codes for the Spot instance request, if any.

          • Code (string) --

            The reason code for the Spot instance state change.

          • Message (string) --

            The message for the Spot instance state change.

        • InstanceId (string) --

          The instance ID, if an instance has been launched to fulfill the Spot instance request.

        • LaunchGroup (string) --

          The instance launch group. Launch groups are Spot instances that launch together and terminate together.

        • LaunchSpecification (dict) --

          Additional information for launching instances.

          • UserData (string) --

            The user data to make available to the instances. 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.

          • SecurityGroups (list) --

            One or more security groups. When requesting instances in a VPC, you must specify the IDs of the security groups. When requesting instances in EC2-Classic, you can specify the names or the IDs of the security groups.

            • (dict) --

              Describes a security group.

              • GroupName (string) --

                The name of the security group.

              • GroupId (string) --

                The ID of the security group.

          • AddressingType (string) --

            Deprecated.

          • BlockDeviceMappings (list) --

            One or more block device mapping entries.

            • (dict) --

              Describes a block device mapping.

              • DeviceName (string) --

                The device name (for example, /dev/sdh or xvdh ).

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

              • Ebs (dict) --

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

                • Encrypted (boolean) --

                  Indicates whether the EBS volume is encrypted. Encrypted volumes can only be attached to instances that support Amazon EBS encryption. If you are creating a volume from a snapshot, you can't specify an encryption value. This is because only blank volumes can be encrypted on creation.

                • DeleteOnTermination (boolean) --

                  Indicates whether the EBS volume is deleted on instance termination.

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

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

                • VolumeType (string) --

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

                  Default: standard

              • NoDevice (string) --

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

          • 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 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

          • IamInstanceProfile (dict) --

            The IAM instance profile.

            • Arn (string) --

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

            • Name (string) --

              The name of the instance profile.

          • ImageId (string) --

            The ID of the AMI.

          • InstanceType (string) --

            The instance type.

          • KernelId (string) --

            The ID of the kernel.

          • KeyName (string) --

            The name of the key pair.

          • NetworkInterfaces (list) --

            One or more network interfaces. If you specify a network interface, you must specify subnet IDs and security group IDs using the network interface.

            • (dict) --

              Describes a network interface.

              • AssociatePublicIpAddress (boolean) --

                Indicates whether to assign a public IPv4 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 .

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

              • Description (string) --

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

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

              • Groups (list) --

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

                • (string) --

              • Ipv6AddressCount (integer) --

                A number of IPv6 addresses to assign to the network interface. Amazon EC2 chooses the IPv6 addresses from the range of the subnet. You cannot specify this option and the option to assign specific IPv6 addresses in the same request. You can specify this option if you've specified a minimum number of instances to launch.

              • Ipv6Addresses (list) --

                One or more IPv6 addresses to assign to the network interface. You cannot specify this option and the option to assign a number of IPv6 addresses in the same request. You cannot specify this option if you've specified a minimum number of instances to launch.

                • (dict) --

                  Describes an IPv6 address.

                  • Ipv6Address (string) --

                    The IPv6 address.

              • NetworkInterfaceId (string) --

                The ID of the network interface.

              • PrivateIpAddress (string) --

                The private IPv4 address of the network interface. Applies only if creating a network interface when launching an instance. You cannot specify this option if you're launching more than one instance in a RunInstances request.

              • PrivateIpAddresses (list) --

                One or more private IPv4 addresses to assign to the network interface. Only one private IPv4 address can be designated as primary. You cannot specify this option if you're launching more than one instance in a RunInstances request.

                • (dict) --

                  Describes a secondary private IPv4 address for a network interface.

                  • Primary (boolean) --

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

                  • PrivateIpAddress (string) --

                    The private IPv4 addresses.

              • SecondaryPrivateIpAddressCount (integer) --

                The number of secondary private IPv4 addresses. You can't specify this option and specify more than one private IP address using the private IP addresses option. You cannot specify this option if you're launching more than one instance in a RunInstances request.

              • SubnetId (string) --

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

          • Placement (dict) --

            The placement information for the instance.

            • AvailabilityZone (string) --

              The Availability Zone.

              [Spot fleet only] To specify multiple Availability Zones, separate them using commas; for example, "us-west-2a, us-west-2b".

            • GroupName (string) --

              The name of the placement group (for cluster 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 Spot instances.

          • RamdiskId (string) --

            The ID of the RAM disk.

          • SubnetId (string) --

            The ID of the subnet in which to launch the instance.

          • Monitoring (dict) --

            Describes the monitoring of an instance.

            • Enabled (boolean) --

              Indicates whether detailed monitoring is enabled. Otherwise, basic monitoring is enabled.

        • LaunchedAvailabilityZone (string) --

          The Availability Zone in which the bid is launched.

        • ProductDescription (string) --

          The product description associated with the Spot instance.

        • SpotInstanceRequestId (string) --

          The ID of the Spot instance request.

        • SpotPrice (string) --

          The maximum hourly price (bid) for the Spot instance launched to fulfill the request.

        • State (string) --

          The state of the Spot instance request. Spot bid status information can help you track your Spot instance requests. For more information, see Spot Bid Status in the Amazon Elastic Compute Cloud User Guide .

        • Status (dict) --

          The status code and status message describing the Spot instance request.

          • Code (string) --

            The status code. For a list of status codes, see Spot Bid Status Codes in the Amazon Elastic Compute Cloud User Guide .

          • Message (string) --

            The description for the status code.

          • UpdateTime (datetime) --

            The date and time of the most recent status update, in UTC format (for example, YYYY -MM -DD T*HH* :MM :SS Z).

        • Tags (list) --

          Any tags assigned to the resource.

          • (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.

        • Type (string) --

          The Spot instance request type.

        • ValidFrom (datetime) --

          The start date of the request, in UTC format (for example, YYYY -MM -DD T*HH* :MM :SS Z). The request becomes active at this date and time.

        • ValidUntil (datetime) --

          The end date of the request, in UTC format (for example, YYYY -MM -DD T*HH* :MM :SS Z). If this is a one-time request, it remains active until all instances launch, the request is canceled, or this date is reached. If the request is persistent, it remains active until it is canceled or this date is reached.

        • InstanceInterruptionBehavior (string) --

          Indicates whether a Spot instance stops or terminates when it is interrupted.

RunInstances (updated) Link ¶
Changes (request, response)
Request
{'InstanceType': {'x1e.16xlarge',
                  'x1e.2xlarge',
                  'x1e.4xlarge',
                  'x1e.8xlarge',
                  'x1e.xlarge'}}
Response
{'Instances': {'InstanceType': {'x1e.16xlarge',
                                'x1e.2xlarge',
                                'x1e.4xlarge',
                                'x1e.8xlarge',
                                'x1e.xlarge'}}}

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

You can specify a number of options, or leave the default options. The following rules apply:

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

  • [EC2-Classic] If don't specify an Availability Zone, we choose one for you.

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

  • [EC2-VPC] All instances have a network interface with a primary private IPv4 address. If you don't specify this address, we choose one from the IPv4 range of your subnet.

  • Not all instance types support IPv6 addresses. For more information, see Instance Types.

  • If you don't specify a security group ID, we use the default security group. For more information, see Security Groups.

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

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.

An instance is ready for you to use when it's in the running state. You can check the state of your instance using DescribeInstances. You can tag instances and EBS volumes during launch, after launch, or both. For more information, see CreateTags and Tagging Your Amazon EC2 Resources.

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 .

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

See also: AWS API Documentation

Request Syntax

client.run_instances(
    BlockDeviceMappings=[
        {
            'DeviceName': 'string',
            'VirtualName': 'string',
            'Ebs': {
                'Encrypted': True|False,
                'DeleteOnTermination': True|False,
                'Iops': 123,
                'SnapshotId': 'string',
                'VolumeSize': 123,
                'VolumeType': 'standard'|'io1'|'gp2'|'sc1'|'st1'
            },
            'NoDevice': 'string'
        },
    ],
    ImageId='string',
    InstanceType='t1.micro'|'t2.nano'|'t2.micro'|'t2.small'|'t2.medium'|'t2.large'|'t2.xlarge'|'t2.2xlarge'|'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'|'m4.16xlarge'|'m2.xlarge'|'m2.2xlarge'|'m2.4xlarge'|'cr1.8xlarge'|'r3.large'|'r3.xlarge'|'r3.2xlarge'|'r3.4xlarge'|'r3.8xlarge'|'r4.large'|'r4.xlarge'|'r4.2xlarge'|'r4.4xlarge'|'r4.8xlarge'|'r4.16xlarge'|'x1.16xlarge'|'x1.32xlarge'|'x1e.xlarge'|'x1e.2xlarge'|'x1e.4xlarge'|'x1e.8xlarge'|'x1e.16xlarge'|'x1e.32xlarge'|'i2.xlarge'|'i2.2xlarge'|'i2.4xlarge'|'i2.8xlarge'|'i3.large'|'i3.xlarge'|'i3.2xlarge'|'i3.4xlarge'|'i3.8xlarge'|'i3.16xlarge'|'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'|'c5.large'|'c5.xlarge'|'c5.2xlarge'|'c5.4xlarge'|'c5.9xlarge'|'c5.18xlarge'|'cc1.4xlarge'|'cc2.8xlarge'|'g2.2xlarge'|'g2.8xlarge'|'g3.4xlarge'|'g3.8xlarge'|'g3.16xlarge'|'cg1.4xlarge'|'p2.xlarge'|'p2.8xlarge'|'p2.16xlarge'|'p3.2xlarge'|'p3.8xlarge'|'p3.16xlarge'|'d2.xlarge'|'d2.2xlarge'|'d2.4xlarge'|'d2.8xlarge'|'f1.2xlarge'|'f1.16xlarge',
    Ipv6AddressCount=123,
    Ipv6Addresses=[
        {
            'Ipv6Address': 'string'
        },
    ],
    KernelId='string',
    KeyName='string',
    MaxCount=123,
    MinCount=123,
    Monitoring={
        'Enabled': True|False
    },
    Placement={
        'AvailabilityZone': 'string',
        'Affinity': 'string',
        'GroupName': 'string',
        'HostId': 'string',
        'Tenancy': 'default'|'dedicated'|'host',
        'SpreadDomain': 'string'
    },
    RamdiskId='string',
    SecurityGroupIds=[
        'string',
    ],
    SecurityGroups=[
        'string',
    ],
    SubnetId='string',
    UserData='string',
    AdditionalInfo='string',
    ClientToken='string',
    DisableApiTermination=True|False,
    DryRun=True|False,
    EbsOptimized=True|False,
    IamInstanceProfile={
        'Arn': 'string',
        'Name': 'string'
    },
    InstanceInitiatedShutdownBehavior='stop'|'terminate',
    NetworkInterfaces=[
        {
            'AssociatePublicIpAddress': True|False,
            'DeleteOnTermination': True|False,
            'Description': 'string',
            'DeviceIndex': 123,
            'Groups': [
                'string',
            ],
            'Ipv6AddressCount': 123,
            'Ipv6Addresses': [
                {
                    'Ipv6Address': 'string'
                },
            ],
            'NetworkInterfaceId': 'string',
            'PrivateIpAddress': 'string',
            'PrivateIpAddresses': [
                {
                    'Primary': True|False,
                    'PrivateIpAddress': 'string'
                },
            ],
            'SecondaryPrivateIpAddressCount': 123,
            'SubnetId': 'string'
        },
    ],
    PrivateIpAddress='string',
    ElasticGpuSpecification=[
        {
            'Type': 'string'
        },
    ],
    TagSpecifications=[
        {
            'ResourceType': 'customer-gateway'|'dhcp-options'|'image'|'instance'|'internet-gateway'|'network-acl'|'network-interface'|'reserved-instances'|'route-table'|'snapshot'|'spot-instances-request'|'subnet'|'security-group'|'volume'|'vpc'|'vpn-connection'|'vpn-gateway',
            'Tags': [
                {
                    'Key': 'string',
                    'Value': 'string'
                },
            ]
        },
    ]
)
type BlockDeviceMappings

list

param BlockDeviceMappings

One or more block device mapping entries. You can't specify both a snapshot ID and an encryption value. This is because only blank volumes can be encrypted on creation. If a snapshot is the basis for a volume, it is not blank and its encryption status is used for the volume encryption status.

  • (dict) --

    Describes a block device mapping.

    • DeviceName (string) --

      The device name (for example, /dev/sdh or xvdh ).

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

    • Ebs (dict) --

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

      • Encrypted (boolean) --

        Indicates whether the EBS volume is encrypted. Encrypted volumes can only be attached to instances that support Amazon EBS encryption. If you are creating a volume from a snapshot, you can't specify an encryption value. This is because only blank volumes can be encrypted on creation.

      • DeleteOnTermination (boolean) --

        Indicates whether the EBS volume is deleted on instance termination.

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

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

      • VolumeType (string) --

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

        Default: standard

    • NoDevice (string) --

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

type ImageId

string

param ImageId

[REQUIRED]

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

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 Ipv6AddressCount

integer

param Ipv6AddressCount

[EC2-VPC] A number of IPv6 addresses to associate with the primary network interface. Amazon EC2 chooses the IPv6 addresses from the range of your subnet. You cannot specify this option and the option to assign specific IPv6 addresses in the same request. You can specify this option if you've specified a minimum number of instances to launch.

type Ipv6Addresses

list

param Ipv6Addresses

[EC2-VPC] Specify one or more IPv6 addresses from the range of the subnet to associate with the primary network interface. You cannot specify this option and the option to assign a number of IPv6 addresses in the same request. You cannot specify this option if you've specified a minimum number of instances to launch.

  • (dict) --

    Describes an IPv6 address.

    • Ipv6Address (string) --

      The IPv6 address.

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 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 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 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 Monitoring

dict

param Monitoring

The monitoring for the instance.

  • Enabled (boolean) -- [REQUIRED]

    Indicates whether detailed monitoring is enabled. Otherwise, basic monitoring is enabled.

type Placement

dict

param Placement

The placement for the instance.

  • AvailabilityZone (string) --

    The Availability Zone of the instance.

  • Affinity (string) --

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

  • GroupName (string) --

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

  • HostId (string) --

    The ID of the Dedicated Host on which the instance resides. This parameter is not supported for the ImportInstance command.

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

  • SpreadDomain (string) --

    Reserved for future use.

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 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 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 SubnetId

string

param SubnetId

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

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 a 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 AdditionalInfo

string

param AdditionalInfo

Reserved.

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 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. To change this attribute to false after launch, use ModifyInstanceAttribute. Alternatively, if you set InstanceInitiatedShutdownBehavior to terminate , you can terminate the instance by running the shutdown command from the instance.

Default: 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 EbsOptimized

boolean

param EbsOptimized

Indicates whether the instance is optimized for Amazon EBS I/O. This optimization provides dedicated throughput to Amazon EBS and an optimized configuration stack to provide optimal Amazon 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

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 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 NetworkInterfaces

list

param NetworkInterfaces

One or more network interfaces.

  • (dict) --

    Describes a network interface.

    • AssociatePublicIpAddress (boolean) --

      Indicates whether to assign a public IPv4 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 .

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

    • Description (string) --

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

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

    • Groups (list) --

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

      • (string) --

    • Ipv6AddressCount (integer) --

      A number of IPv6 addresses to assign to the network interface. Amazon EC2 chooses the IPv6 addresses from the range of the subnet. You cannot specify this option and the option to assign specific IPv6 addresses in the same request. You can specify this option if you've specified a minimum number of instances to launch.

    • Ipv6Addresses (list) --

      One or more IPv6 addresses to assign to the network interface. You cannot specify this option and the option to assign a number of IPv6 addresses in the same request. You cannot specify this option if you've specified a minimum number of instances to launch.

      • (dict) --

        Describes an IPv6 address.

        • Ipv6Address (string) --

          The IPv6 address.

    • NetworkInterfaceId (string) --

      The ID of the network interface.

    • PrivateIpAddress (string) --

      The private IPv4 address of the network interface. Applies only if creating a network interface when launching an instance. You cannot specify this option if you're launching more than one instance in a RunInstances request.

    • PrivateIpAddresses (list) --

      One or more private IPv4 addresses to assign to the network interface. Only one private IPv4 address can be designated as primary. You cannot specify this option if you're launching more than one instance in a RunInstances request.

      • (dict) --

        Describes a secondary private IPv4 address for a network interface.

        • Primary (boolean) --

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

        • PrivateIpAddress (string) -- [REQUIRED]

          The private IPv4 addresses.

    • SecondaryPrivateIpAddressCount (integer) --

      The number of secondary private IPv4 addresses. You can't specify this option and specify more than one private IP address using the private IP addresses option. You cannot specify this option if you're launching more than one instance in a RunInstances request.

    • SubnetId (string) --

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

type PrivateIpAddress

string

param PrivateIpAddress

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

Only one private IP address can be designated as primary. You can't specify this option if you've specified the option to designate a private IP address as the primary IP address in a network interface specification. You cannot specify this option if you're launching more than one instance in the request.

type ElasticGpuSpecification

list

param ElasticGpuSpecification

An Elastic GPU to associate with the instance.

  • (dict) --

    A specification for an Elastic GPU.

    • Type (string) -- [REQUIRED]

      The type of Elastic GPU.

type TagSpecifications

list

param TagSpecifications

The tags to apply to the resources during launch. You can tag instances and volumes. The specified tags are applied to all instances or volumes that are created during launch.

  • (dict) --

    The tags to apply to a resource when the resource is being created.

    • ResourceType (string) --

      The type of resource to tag. Currently, the resource types that support tagging on creation are instance and volume .

    • Tags (list) --

      The tags to apply to the resource.

      • (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.

rtype

dict

returns

Response Syntax

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

Response Structure

  • (dict) --

    Describes a reservation.

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

        • AmiLaunchIndex (integer) --

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

        • ImageId (string) --

          The ID of the AMI used to launch the instance.

        • InstanceId (string) --

          The ID of the instance.

        • InstanceType (string) --

          The instance type.

        • KernelId (string) --

          The kernel associated with this instance, if applicable.

        • KeyName (string) --

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

        • LaunchTime (datetime) --

          The time the instance was launched.

        • Monitoring (dict) --

          The monitoring for the instance.

          • State (string) --

            Indicates whether detailed monitoring is enabled. Otherwise, basic monitoring is enabled.

        • Placement (dict) --

          The location where the instance launched, if applicable.

          • AvailabilityZone (string) --

            The Availability Zone of the instance.

          • Affinity (string) --

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

          • GroupName (string) --

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

          • HostId (string) --

            The ID of the Dedicated Host on which the instance resides. This parameter is not supported for the ImportInstance command.

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

          • SpreadDomain (string) --

            Reserved for future use.

        • Platform (string) --

          The value is Windows for Windows instances; otherwise blank.

        • PrivateDnsName (string) --

          (IPv4 only) The private DNS hostname name assigned to the instance. This DNS hostname can only be used inside the Amazon EC2 network. This name is not available until the instance enters the running state.

          [EC2-VPC] The Amazon-provided DNS server resolves Amazon-provided private DNS hostnames if you've enabled DNS resolution and DNS hostnames in your VPC. If you are not using the Amazon-provided DNS server in your VPC, your custom domain name servers must resolve the hostname as appropriate.

        • PrivateIpAddress (string) --

          The private IPv4 address assigned to the instance.

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

        • PublicDnsName (string) --

          (IPv4 only) 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.

        • PublicIpAddress (string) --

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

        • RamdiskId (string) --

          The RAM disk associated with this instance, if applicable.

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

        • StateTransitionReason (string) --

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

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

        • Architecture (string) --

          The architecture of the image.

        • BlockDeviceMappings (list) --

          Any block device mapping entries for the instance.

          • (dict) --

            Describes a block device mapping.

            • DeviceName (string) --

              The device name (for example, /dev/sdh or xvdh ).

            • Ebs (dict) --

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

              • AttachTime (datetime) --

                The time stamp when the attachment initiated.

              • DeleteOnTermination (boolean) --

                Indicates whether the volume is deleted on instance termination.

              • Status (string) --

                The attachment state.

              • VolumeId (string) --

                The ID of the EBS volume.

        • ClientToken (string) --

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

        • EbsOptimized (boolean) --

          Indicates whether the instance is optimized for Amazon 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.

        • EnaSupport (boolean) --

          Specifies whether enhanced networking with ENA is enabled.

        • Hypervisor (string) --

          The hypervisor type of the instance.

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

        • InstanceLifecycle (string) --

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

        • ElasticGpuAssociations (list) --

          The Elastic GPU associated with the instance.

          • (dict) --

            Describes the association between an instance and an Elastic GPU.

            • ElasticGpuId (string) --

              The ID of the Elastic GPU.

            • ElasticGpuAssociationId (string) --

              The ID of the association.

            • ElasticGpuAssociationState (string) --

              The state of the association between the instance and the Elastic GPU.

            • ElasticGpuAssociationTime (string) --

              The time the Elastic GPU was associated with the instance.

        • NetworkInterfaces (list) --

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

          • (dict) --

            Describes a network interface.

            • Association (dict) --

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

              • IpOwnerId (string) --

                The ID of the owner of the Elastic IP address.

              • PublicDnsName (string) --

                The public DNS name.

              • PublicIp (string) --

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

            • Attachment (dict) --

              The network interface attachment.

              • AttachTime (datetime) --

                The time stamp when the attachment initiated.

              • AttachmentId (string) --

                The ID of the network interface attachment.

              • DeleteOnTermination (boolean) --

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

              • DeviceIndex (integer) --

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

              • Status (string) --

                The attachment state.

            • Description (string) --

              The description.

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

            • Ipv6Addresses (list) --

              One or more IPv6 addresses associated with the network interface.

              • (dict) --

                Describes an IPv6 address.

                • Ipv6Address (string) --

                  The IPv6 address.

            • MacAddress (string) --

              The MAC address.

            • NetworkInterfaceId (string) --

              The ID of the network interface.

            • OwnerId (string) --

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

            • PrivateDnsName (string) --

              The private DNS name.

            • PrivateIpAddress (string) --

              The IPv4 address of the network interface within the subnet.

            • PrivateIpAddresses (list) --

              One or more private IPv4 addresses associated with the network interface.

              • (dict) --

                Describes a private IPv4 address.

                • Association (dict) --

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

                  • IpOwnerId (string) --

                    The ID of the owner of the Elastic IP address.

                  • PublicDnsName (string) --

                    The public DNS name.

                  • PublicIp (string) --

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

                • Primary (boolean) --

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

                • PrivateDnsName (string) --

                  The private IPv4 DNS name.

                • PrivateIpAddress (string) --

                  The private IPv4 address of the network interface.

            • SourceDestCheck (boolean) --

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

            • Status (string) --

              The status of the network interface.

            • SubnetId (string) --

              The ID of the subnet.

            • VpcId (string) --

              The ID of the VPC.

        • RootDeviceName (string) --

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

        • RootDeviceType (string) --

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

        • 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 that checking is enabled, and false means that 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 .

        • SpotInstanceRequestId (string) --

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

        • SriovNetSupport (string) --

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

        • 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.InsufficientInstanceCapacity : There was insufficient instance capacity to satisfy the launch request.

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

            • Server.ScheduledStop : The instance was stopped due to a scheduled retirement.

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

            • 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.InstanceTerminated : The instance was terminated or rebooted during AMI creation.

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

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

        • VirtualizationType (string) --

          The virtualization type of the instance.

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

    • ReservationId (string) --

      The ID of the reservation.