Amazon Elastic Compute Cloud

2015/10/06 - Amazon Elastic Compute Cloud - 2 updated api methods

DescribeSpotInstanceRequests (updated) Link ¶
Changes (response)
{'SpotInstanceRequests': {'ActualBlockHourlyPrice': 'string',
                          'BlockDurationMinutes': 'integer'}}

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 .

Request Syntax

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

boolean

param DryRun

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

type SpotInstanceRequestIds

list

param SpotInstanceRequestIds

One or more Spot instance request IDs.

  • (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 Amazon EBS volume is deleted on instance termination.

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

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

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

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

  • 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, m1.small ).

  • launch.kernel-id - The kernel ID.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

rtype

dict

returns

Response Syntax

{
    'SpotInstanceRequests': [
        {
            'SpotInstanceRequestId': 'string',
            'SpotPrice': 'string',
            'Type': 'one-time'|'persistent',
            'State': 'open'|'active'|'closed'|'cancelled'|'failed',
            'Fault': {
                'Code': 'string',
                'Message': 'string'
            },
            'Status': {
                'Code': 'string',
                'UpdateTime': datetime(2015, 1, 1),
                'Message': 'string'
            },
            'ValidFrom': datetime(2015, 1, 1),
            'ValidUntil': datetime(2015, 1, 1),
            'LaunchGroup': 'string',
            'AvailabilityZoneGroup': 'string',
            'LaunchSpecification': {
                'ImageId': 'string',
                'KeyName': 'string',
                'SecurityGroups': [
                    {
                        'GroupName': 'string',
                        'GroupId': 'string'
                    },
                ],
                'UserData': 'string',
                'AddressingType': 'string',
                'InstanceType': 't1.micro'|'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'|'t2.micro'|'t2.small'|'t2.medium'|'t2.large'|'m2.xlarge'|'m2.2xlarge'|'m2.4xlarge'|'cr1.8xlarge'|'i2.xlarge'|'i2.2xlarge'|'i2.4xlarge'|'i2.8xlarge'|'hi1.4xlarge'|'hs1.8xlarge'|'c1.medium'|'c1.xlarge'|'c3.large'|'c3.xlarge'|'c3.2xlarge'|'c3.4xlarge'|'c3.8xlarge'|'c4.large'|'c4.xlarge'|'c4.2xlarge'|'c4.4xlarge'|'c4.8xlarge'|'cc1.4xlarge'|'cc2.8xlarge'|'g2.2xlarge'|'cg1.4xlarge'|'r3.large'|'r3.xlarge'|'r3.2xlarge'|'r3.4xlarge'|'r3.8xlarge'|'d2.xlarge'|'d2.2xlarge'|'d2.4xlarge'|'d2.8xlarge',
                'Placement': {
                    'AvailabilityZone': 'string',
                    'GroupName': 'string'
                },
                'KernelId': 'string',
                'RamdiskId': 'string',
                'BlockDeviceMappings': [
                    {
                        'VirtualName': 'string',
                        'DeviceName': 'string',
                        'Ebs': {
                            'SnapshotId': 'string',
                            'VolumeSize': 123,
                            'DeleteOnTermination': True|False,
                            'VolumeType': 'standard'|'io1'|'gp2',
                            'Iops': 123,
                            'Encrypted': True|False
                        },
                        'NoDevice': 'string'
                    },
                ],
                'SubnetId': 'string',
                'NetworkInterfaces': [
                    {
                        'NetworkInterfaceId': 'string',
                        'DeviceIndex': 123,
                        'SubnetId': 'string',
                        'Description': 'string',
                        'PrivateIpAddress': 'string',
                        'Groups': [
                            'string',
                        ],
                        'DeleteOnTermination': True|False,
                        'PrivateIpAddresses': [
                            {
                                'PrivateIpAddress': 'string',
                                'Primary': True|False
                            },
                        ],
                        'SecondaryPrivateIpAddressCount': 123,
                        'AssociatePublicIpAddress': True|False
                    },
                ],
                'IamInstanceProfile': {
                    'Arn': 'string',
                    'Name': 'string'
                },
                'EbsOptimized': True|False,
                'Monitoring': {
                    'Enabled': True|False
                }
            },
            'InstanceId': 'string',
            'CreateTime': datetime(2015, 1, 1),
            'ProductDescription': 'Linux/UNIX'|'Linux/UNIX (Amazon VPC)'|'Windows'|'Windows (Amazon VPC)',
            'BlockDurationMinutes': 123,
            'ActualBlockHourlyPrice': 'string',
            'Tags': [
                {
                    'Key': 'string',
                    'Value': 'string'
                },
            ],
            'LaunchedAvailabilityZone': 'string'
        },
    ]
}

Response Structure

  • (dict) --

    Contains the output of DescribeSpotInstanceRequests.

    • SpotInstanceRequests (list) --

      One or more Spot instance requests.

      • (dict) --

        Describes a Spot instance request.

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

        • Type (string) --

          The Spot instance request type.

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

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

        • Status (dict) --

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

          • Code (string) --

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

          • Message (string) --

            The description for the status code.

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

        • LaunchGroup (string) --

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

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

        • LaunchSpecification (dict) --

          Additional information for launching instances.

          • ImageId (string) --

            The ID of the AMI.

          • KeyName (string) --

            The name of the key pair.

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

          • UserData (string) --

            The Base64-encoded MIME user data to make available to the instances.

          • AddressingType (string) --

            Deprecated.

          • InstanceType (string) --

            The instance type.

          • Placement (dict) --

            The placement information for the instance.

            • AvailabilityZone (string) --

              The Availability Zone.

            • GroupName (string) --

              The name of the placement group (for cluster instances).

          • KernelId (string) --

            The ID of the kernel.

          • RamdiskId (string) --

            The ID of the RAM disk.

          • BlockDeviceMappings (list) --

            One or more block device mapping entries.

            • (dict) --

              Describes a block device mapping.

              • VirtualName (string) --

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

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

              • DeviceName (string) --

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

              • Ebs (dict) --

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

                • SnapshotId (string) --

                  The ID of the snapshot.

                • VolumeSize (integer) --

                  The size of the volume, in GiB.

                  Constraints: 1-1024 for standard volumes, 1-16384 for gp2 volumes, and 4-16384 for io1 volumes. If you specify a snapshot, the volume size must be equal to or larger than the snapshot size.

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

                • DeleteOnTermination (boolean) --

                  Indicates whether the EBS volume is deleted on instance termination.

                • VolumeType (string) --

                  The volume type. gp2 for General Purpose (SSD) volumes, io1 for Provisioned IOPS (SSD) volumes, and standard for Magnetic volumes.

                  Default: standard

                • Iops (integer) --

                  The number of I/O operations per second (IOPS) that the volume supports. For Provisioned IOPS (SSD) volumes, this represents the number of IOPS that are provisioned for the volume. For General Purpose (SSD) volumes, this represents the baseline performance of the volume and the rate at which the volume accumulates I/O credits for bursting. For more information on 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 to 20000 for Provisioned IOPS (SSD) volumes and 3 to 10000 for General Purpose (SSD) volumes.

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

                • Encrypted (boolean) --

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

              • NoDevice (string) --

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

          • SubnetId (string) --

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

          • NetworkInterfaces (list) --

            One or more network interfaces.

            • (dict) --

              Describes a network interface.

              • NetworkInterfaceId (string) --

                The ID of the network interface.

              • DeviceIndex (integer) --

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

              • SubnetId (string) --

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

              • Description (string) --

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

              • PrivateIpAddress (string) --

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

              • Groups (list) --

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

                • (string) --

              • DeleteOnTermination (boolean) --

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

              • PrivateIpAddresses (list) --

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

                • (dict) --

                  Describes a secondary private IP address for a network interface.

                  • PrivateIpAddress (string) --

                    The private IP addresses.

                  • Primary (boolean) --

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

              • SecondaryPrivateIpAddressCount (integer) --

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

              • AssociatePublicIpAddress (boolean) --

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

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

          • 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

          • Monitoring (dict) --

            Describes the monitoring for the instance.

            • Enabled (boolean) --

              Indicates whether monitoring is enabled for the instance.

        • InstanceId (string) --

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

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

        • ProductDescription (string) --

          The product description associated with the Spot instance.

        • BlockDurationMinutes (integer) --

          The required duration for the Spot instance, in minutes.

        • ActualBlockHourlyPrice (string) --

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

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

        • LaunchedAvailabilityZone (string) --

          The Availability Zone in which the bid is launched.

RequestSpotInstances (updated) Link ¶
Changes (request, response)
Request
{'BlockDurationMinutes': 'integer'}
Response
{'SpotInstanceRequests': {'ActualBlockHourlyPrice': 'string',
                          'BlockDurationMinutes': 'integer'}}

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 .

Request Syntax

client.request_spot_instances(
    DryRun=True|False,
    SpotPrice='string',
    ClientToken='string',
    InstanceCount=123,
    Type='one-time'|'persistent',
    ValidFrom=datetime(2015, 1, 1),
    ValidUntil=datetime(2015, 1, 1),
    LaunchGroup='string',
    AvailabilityZoneGroup='string',
    BlockDurationMinutes=123,
    LaunchSpecification={
        'ImageId': 'string',
        'KeyName': 'string',
        'SecurityGroups': [
            'string',
        ],
        'UserData': 'string',
        'AddressingType': 'string',
        'InstanceType': 't1.micro'|'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'|'t2.micro'|'t2.small'|'t2.medium'|'t2.large'|'m2.xlarge'|'m2.2xlarge'|'m2.4xlarge'|'cr1.8xlarge'|'i2.xlarge'|'i2.2xlarge'|'i2.4xlarge'|'i2.8xlarge'|'hi1.4xlarge'|'hs1.8xlarge'|'c1.medium'|'c1.xlarge'|'c3.large'|'c3.xlarge'|'c3.2xlarge'|'c3.4xlarge'|'c3.8xlarge'|'c4.large'|'c4.xlarge'|'c4.2xlarge'|'c4.4xlarge'|'c4.8xlarge'|'cc1.4xlarge'|'cc2.8xlarge'|'g2.2xlarge'|'cg1.4xlarge'|'r3.large'|'r3.xlarge'|'r3.2xlarge'|'r3.4xlarge'|'r3.8xlarge'|'d2.xlarge'|'d2.2xlarge'|'d2.4xlarge'|'d2.8xlarge',
        'Placement': {
            'AvailabilityZone': 'string',
            'GroupName': 'string'
        },
        'KernelId': 'string',
        'RamdiskId': 'string',
        'BlockDeviceMappings': [
            {
                'VirtualName': 'string',
                'DeviceName': 'string',
                'Ebs': {
                    'SnapshotId': 'string',
                    'VolumeSize': 123,
                    'DeleteOnTermination': True|False,
                    'VolumeType': 'standard'|'io1'|'gp2',
                    'Iops': 123,
                    'Encrypted': True|False
                },
                'NoDevice': 'string'
            },
        ],
        'SubnetId': 'string',
        'NetworkInterfaces': [
            {
                'NetworkInterfaceId': 'string',
                'DeviceIndex': 123,
                'SubnetId': 'string',
                'Description': 'string',
                'PrivateIpAddress': 'string',
                'Groups': [
                    'string',
                ],
                'DeleteOnTermination': True|False,
                'PrivateIpAddresses': [
                    {
                        'PrivateIpAddress': 'string',
                        'Primary': True|False
                    },
                ],
                'SecondaryPrivateIpAddressCount': 123,
                'AssociatePublicIpAddress': True|False
            },
        ],
        'IamInstanceProfile': {
            'Arn': 'string',
            'Name': 'string'
        },
        'EbsOptimized': True|False,
        'Monitoring': {
            'Enabled': True|False
        },
        'SecurityGroupIds': [
            '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 SpotPrice

string

param SpotPrice

[REQUIRED]

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

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 InstanceCount

integer

param InstanceCount

The maximum number of Spot instances to launch.

Default: 1

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 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 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, 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 required duration.

type LaunchSpecification

dict

param LaunchSpecification

Describes the launch specification for an instance.

  • ImageId (string) --

    The ID of the AMI.

  • KeyName (string) --

    The name of the key pair.

  • SecurityGroups (list) --

    • (string) --

  • UserData (string) --

    The Base64-encoded MIME user data to make available to the instances.

  • AddressingType (string) --

    Deprecated.

  • InstanceType (string) --

    The instance type.

  • Placement (dict) --

    The placement information for the instance.

    • AvailabilityZone (string) --

      The Availability Zone.

    • GroupName (string) --

      The name of the placement group (for cluster instances).

  • KernelId (string) --

    The ID of the kernel.

  • RamdiskId (string) --

    The ID of the RAM disk.

  • BlockDeviceMappings (list) --

    One or more block device mapping entries.

    • (dict) --

      Describes a block device mapping.

      • VirtualName (string) --

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

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

      • DeviceName (string) --

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

      • Ebs (dict) --

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

        • SnapshotId (string) --

          The ID of the snapshot.

        • VolumeSize (integer) --

          The size of the volume, in GiB.

          Constraints: 1-1024 for standard volumes, 1-16384 for gp2 volumes, and 4-16384 for io1 volumes. If you specify a snapshot, the volume size must be equal to or larger than the snapshot size.

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

        • DeleteOnTermination (boolean) --

          Indicates whether the EBS volume is deleted on instance termination.

        • VolumeType (string) --

          The volume type. gp2 for General Purpose (SSD) volumes, io1 for Provisioned IOPS (SSD) volumes, and standard for Magnetic volumes.

          Default: standard

        • Iops (integer) --

          The number of I/O operations per second (IOPS) that the volume supports. For Provisioned IOPS (SSD) volumes, this represents the number of IOPS that are provisioned for the volume. For General Purpose (SSD) volumes, this represents the baseline performance of the volume and the rate at which the volume accumulates I/O credits for bursting. For more information on 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 to 20000 for Provisioned IOPS (SSD) volumes and 3 to 10000 for General Purpose (SSD) volumes.

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

        • Encrypted (boolean) --

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

      • NoDevice (string) --

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

  • SubnetId (string) --

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

  • NetworkInterfaces (list) --

    One or more network interfaces.

    • (dict) --

      Describes a network interface.

      • NetworkInterfaceId (string) --

        The ID of the network interface.

      • DeviceIndex (integer) --

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

      • SubnetId (string) --

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

      • Description (string) --

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

      • PrivateIpAddress (string) --

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

      • Groups (list) --

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

        • (string) --

      • DeleteOnTermination (boolean) --

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

      • PrivateIpAddresses (list) --

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

        • (dict) --

          Describes a secondary private IP address for a network interface.

          • PrivateIpAddress (string) -- [REQUIRED]

            The private IP addresses.

          • Primary (boolean) --

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

      • SecondaryPrivateIpAddressCount (integer) --

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

      • AssociatePublicIpAddress (boolean) --

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

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

  • 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

  • Monitoring (dict) --

    Describes the monitoring for the instance.

    • Enabled (boolean) -- [REQUIRED]

      Indicates whether monitoring is enabled for the instance.

  • SecurityGroupIds (list) --

    • (string) --

rtype

dict

returns

Response Syntax

{
    'SpotInstanceRequests': [
        {
            'SpotInstanceRequestId': 'string',
            'SpotPrice': 'string',
            'Type': 'one-time'|'persistent',
            'State': 'open'|'active'|'closed'|'cancelled'|'failed',
            'Fault': {
                'Code': 'string',
                'Message': 'string'
            },
            'Status': {
                'Code': 'string',
                'UpdateTime': datetime(2015, 1, 1),
                'Message': 'string'
            },
            'ValidFrom': datetime(2015, 1, 1),
            'ValidUntil': datetime(2015, 1, 1),
            'LaunchGroup': 'string',
            'AvailabilityZoneGroup': 'string',
            'LaunchSpecification': {
                'ImageId': 'string',
                'KeyName': 'string',
                'SecurityGroups': [
                    {
                        'GroupName': 'string',
                        'GroupId': 'string'
                    },
                ],
                'UserData': 'string',
                'AddressingType': 'string',
                'InstanceType': 't1.micro'|'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'|'t2.micro'|'t2.small'|'t2.medium'|'t2.large'|'m2.xlarge'|'m2.2xlarge'|'m2.4xlarge'|'cr1.8xlarge'|'i2.xlarge'|'i2.2xlarge'|'i2.4xlarge'|'i2.8xlarge'|'hi1.4xlarge'|'hs1.8xlarge'|'c1.medium'|'c1.xlarge'|'c3.large'|'c3.xlarge'|'c3.2xlarge'|'c3.4xlarge'|'c3.8xlarge'|'c4.large'|'c4.xlarge'|'c4.2xlarge'|'c4.4xlarge'|'c4.8xlarge'|'cc1.4xlarge'|'cc2.8xlarge'|'g2.2xlarge'|'cg1.4xlarge'|'r3.large'|'r3.xlarge'|'r3.2xlarge'|'r3.4xlarge'|'r3.8xlarge'|'d2.xlarge'|'d2.2xlarge'|'d2.4xlarge'|'d2.8xlarge',
                'Placement': {
                    'AvailabilityZone': 'string',
                    'GroupName': 'string'
                },
                'KernelId': 'string',
                'RamdiskId': 'string',
                'BlockDeviceMappings': [
                    {
                        'VirtualName': 'string',
                        'DeviceName': 'string',
                        'Ebs': {
                            'SnapshotId': 'string',
                            'VolumeSize': 123,
                            'DeleteOnTermination': True|False,
                            'VolumeType': 'standard'|'io1'|'gp2',
                            'Iops': 123,
                            'Encrypted': True|False
                        },
                        'NoDevice': 'string'
                    },
                ],
                'SubnetId': 'string',
                'NetworkInterfaces': [
                    {
                        'NetworkInterfaceId': 'string',
                        'DeviceIndex': 123,
                        'SubnetId': 'string',
                        'Description': 'string',
                        'PrivateIpAddress': 'string',
                        'Groups': [
                            'string',
                        ],
                        'DeleteOnTermination': True|False,
                        'PrivateIpAddresses': [
                            {
                                'PrivateIpAddress': 'string',
                                'Primary': True|False
                            },
                        ],
                        'SecondaryPrivateIpAddressCount': 123,
                        'AssociatePublicIpAddress': True|False
                    },
                ],
                'IamInstanceProfile': {
                    'Arn': 'string',
                    'Name': 'string'
                },
                'EbsOptimized': True|False,
                'Monitoring': {
                    'Enabled': True|False
                }
            },
            'InstanceId': 'string',
            'CreateTime': datetime(2015, 1, 1),
            'ProductDescription': 'Linux/UNIX'|'Linux/UNIX (Amazon VPC)'|'Windows'|'Windows (Amazon VPC)',
            'BlockDurationMinutes': 123,
            'ActualBlockHourlyPrice': 'string',
            'Tags': [
                {
                    'Key': 'string',
                    'Value': 'string'
                },
            ],
            'LaunchedAvailabilityZone': 'string'
        },
    ]
}

Response Structure

  • (dict) --

    Contains the output of RequestSpotInstances.

    • SpotInstanceRequests (list) --

      One or more Spot instance requests.

      • (dict) --

        Describes a Spot instance request.

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

        • Type (string) --

          The Spot instance request type.

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

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

        • Status (dict) --

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

          • Code (string) --

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

          • Message (string) --

            The description for the status code.

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

        • LaunchGroup (string) --

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

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

        • LaunchSpecification (dict) --

          Additional information for launching instances.

          • ImageId (string) --

            The ID of the AMI.

          • KeyName (string) --

            The name of the key pair.

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

          • UserData (string) --

            The Base64-encoded MIME user data to make available to the instances.

          • AddressingType (string) --

            Deprecated.

          • InstanceType (string) --

            The instance type.

          • Placement (dict) --

            The placement information for the instance.

            • AvailabilityZone (string) --

              The Availability Zone.

            • GroupName (string) --

              The name of the placement group (for cluster instances).

          • KernelId (string) --

            The ID of the kernel.

          • RamdiskId (string) --

            The ID of the RAM disk.

          • BlockDeviceMappings (list) --

            One or more block device mapping entries.

            • (dict) --

              Describes a block device mapping.

              • VirtualName (string) --

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

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

              • DeviceName (string) --

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

              • Ebs (dict) --

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

                • SnapshotId (string) --

                  The ID of the snapshot.

                • VolumeSize (integer) --

                  The size of the volume, in GiB.

                  Constraints: 1-1024 for standard volumes, 1-16384 for gp2 volumes, and 4-16384 for io1 volumes. If you specify a snapshot, the volume size must be equal to or larger than the snapshot size.

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

                • DeleteOnTermination (boolean) --

                  Indicates whether the EBS volume is deleted on instance termination.

                • VolumeType (string) --

                  The volume type. gp2 for General Purpose (SSD) volumes, io1 for Provisioned IOPS (SSD) volumes, and standard for Magnetic volumes.

                  Default: standard

                • Iops (integer) --

                  The number of I/O operations per second (IOPS) that the volume supports. For Provisioned IOPS (SSD) volumes, this represents the number of IOPS that are provisioned for the volume. For General Purpose (SSD) volumes, this represents the baseline performance of the volume and the rate at which the volume accumulates I/O credits for bursting. For more information on 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 to 20000 for Provisioned IOPS (SSD) volumes and 3 to 10000 for General Purpose (SSD) volumes.

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

                • Encrypted (boolean) --

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

              • NoDevice (string) --

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

          • SubnetId (string) --

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

          • NetworkInterfaces (list) --

            One or more network interfaces.

            • (dict) --

              Describes a network interface.

              • NetworkInterfaceId (string) --

                The ID of the network interface.

              • DeviceIndex (integer) --

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

              • SubnetId (string) --

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

              • Description (string) --

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

              • PrivateIpAddress (string) --

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

              • Groups (list) --

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

                • (string) --

              • DeleteOnTermination (boolean) --

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

              • PrivateIpAddresses (list) --

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

                • (dict) --

                  Describes a secondary private IP address for a network interface.

                  • PrivateIpAddress (string) --

                    The private IP addresses.

                  • Primary (boolean) --

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

              • SecondaryPrivateIpAddressCount (integer) --

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

              • AssociatePublicIpAddress (boolean) --

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

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

          • 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

          • Monitoring (dict) --

            Describes the monitoring for the instance.

            • Enabled (boolean) --

              Indicates whether monitoring is enabled for the instance.

        • InstanceId (string) --

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

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

        • ProductDescription (string) --

          The product description associated with the Spot instance.

        • BlockDurationMinutes (integer) --

          The required duration for the Spot instance, in minutes.

        • ActualBlockHourlyPrice (string) --

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

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

        • LaunchedAvailabilityZone (string) --

          The Availability Zone in which the bid is launched.