Amazon Elastic Compute Cloud

2018/05/02 - Amazon Elastic Compute Cloud - 6 new 2 updated api methods

Changes  Amazon EC2 Fleet is a new feature that simplifies the provisioning of Amazon EC2 capacity across different EC2 instance types, Availability Zones, and the On-Demand, Reserved Instance, and Spot Instance purchase models. With a single API call, you can now provision capacity to achieve desired scale, performance, and cost.

DescribeFleetInstances (new) Link ¶

Describes the running instances for the specified EC2 Fleet.

See also: AWS API Documentation

Request Syntax

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

string

param FleetId

[REQUIRED]

The ID of the EC2 Fleet.

type Filters

list

param Filters

One or more filters.

  • (dict) --

    A filter name and value pair that is used to return a more specific list of results from a describe operation. Filters can be used to match a set of resources by specific criteria, such as tags, attributes, or IDs. The filters supported by a describe operation are documented with the describe operation. For example:

    • DescribeAvailabilityZones

    • DescribeImages

    • DescribeInstances

    • DescribeKeyPairs

    • DescribeSecurityGroups

    • DescribeSnapshots

    • DescribeSubnets

    • DescribeTags

    • DescribeVolumes

    • DescribeVpcs

    • 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

{
    'ActiveInstances': [
        {
            'InstanceId': 'string',
            'InstanceType': 'string',
            'SpotInstanceRequestId': 'string',
            'InstanceHealth': 'healthy'|'unhealthy'
        },
    ],
    'NextToken': 'string',
    'FleetId': 'string'
}

Response Structure

  • (dict) --

    • ActiveInstances (list) --

      The running instances. This list is refreshed periodically and might be out of date.

      • (dict) --

        Describes a running instance in a Spot Fleet.

        • InstanceId (string) --

          The ID of the instance.

        • InstanceType (string) --

          The instance type.

        • SpotInstanceRequestId (string) --

          The ID of the Spot Instance request.

        • InstanceHealth (string) --

          The health status of the instance. If the status of either the instance status check or the system status check is impaired , the health status of the instance is unhealthy . Otherwise, the health status is healthy .

    • NextToken (string) --

      The token for the next set of results.

    • FleetId (string) --

      The ID of the EC2 Fleet.

DescribeFleetHistory (new) Link ¶

Describes the events for the specified EC2 Fleet during the specified time.

See also: AWS API Documentation

Request Syntax

client.describe_fleet_history(
    DryRun=True|False,
    EventType='instance-change'|'fleet-change'|'service-error',
    MaxResults=123,
    NextToken='string',
    FleetId='string',
    StartTime=datetime(2015, 1, 1)
)
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 EventType

string

param EventType

The type of events to describe. By default, all events are described.

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 FleetId

string

param FleetId

[REQUIRED]

The ID of the EC2 Fleet.

type StartTime

datetime

param StartTime

[REQUIRED]

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

rtype

dict

returns

Response Syntax

{
    'HistoryRecords': [
        {
            'EventInformation': {
                'EventDescription': 'string',
                'EventSubType': 'string',
                'InstanceId': 'string'
            },
            'EventType': 'instance-change'|'fleet-change'|'service-error',
            'Timestamp': datetime(2015, 1, 1)
        },
    ],
    'LastEvaluatedTime': datetime(2015, 1, 1),
    'NextToken': 'string',
    'FleetId': 'string',
    'StartTime': datetime(2015, 1, 1)
}

Response Structure

  • (dict) --

    • HistoryRecords (list) --

      Information about the events in the history of the EC2 Fleet.

      • (dict) --

        Describes an event in the history of the EC2 Fleet.

        • EventInformation (dict) --

          Information about the event.

          • EventDescription (string) --

            The description of the event.

          • EventSubType (string) --

            The event.

            The following are the error events:

            • iamFleetRoleInvalid - The Spot Fleet did not have the required permissions either to launch or terminate an instance.

            • launchSpecTemporarilyBlacklisted - The configuration is not valid and several attempts to launch instances have failed. For more information, see the description of the event.

            • spotFleetRequestConfigurationInvalid - The configuration is not valid. For more information, see the description of the event.

            • spotInstanceCountLimitExceeded - You've reached the limit on the number of Spot Instances that you can launch.

            The following are the fleetRequestChange events:

            • active - The Spot Fleet has been validated and Amazon EC2 is attempting to maintain the target number of running Spot Instances.

            • cancelled - The Spot Fleet is canceled and has no running Spot Instances. The Spot Fleet will be deleted two days after its instances were terminated.

            • cancelled_running - The Spot Fleet is canceled and does not launch additional Spot Instances. Existing Spot Instances continue to run until they are interrupted or terminated.

            • cancelled_terminating - The Spot Fleet is canceled and its Spot Instances are terminating.

            • expired - The Spot Fleet request has expired. A subsequent event indicates that the instances were terminated, if the request was created with TerminateInstancesWithExpiration set.

            • modify_in_progress - A request to modify the Spot Fleet request was accepted and is in progress.

            • modify_successful - The Spot Fleet request was modified.

            • price_update - The price for a launch configuration was adjusted because it was too high. This change is permanent.

            • submitted - The Spot Fleet request is being evaluated and Amazon EC2 is preparing to launch the target number of Spot Instances.

            The following are the instanceChange events:

            • launched - A request was fulfilled and a new instance was launched.

            • terminated - An instance was terminated by the user.

            The following are the Information events:

            • launchSpecUnusable - The price in a launch specification is not valid because it is below the Spot price or the Spot price is above the On-Demand price.

            • fleetProgressHalted - The price in every launch specification is not valid. A launch specification might become valid if the Spot price changes.

          • InstanceId (string) --

            The ID of the instance. This information is available only for instanceChange events.

        • EventType (string) --

          The event type.

        • Timestamp (datetime) --

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

    • LastEvaluatedTime (datetime) --

      The last date and time for the events, in UTC format (for example, YYYY -MM -DD T*HH* :MM :SS Z). All records up to this time were retrieved.

      If nextToken indicates that there are more results, this value is not present.

    • NextToken (string) --

      The token for the next set of results.

    • FleetId (string) --

      The ID of the EC Fleet.

    • StartTime (datetime) --

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

ModifyFleet (new) Link ¶

Modifies the specified EC2 Fleet.

While the EC2 Fleet is being modified, it is in the modifying state.

See also: AWS API Documentation

Request Syntax

client.modify_fleet(
    DryRun=True|False,
    ExcessCapacityTerminationPolicy='no-termination'|'termination',
    FleetId='string',
    TargetCapacitySpecification={
        'TotalTargetCapacity': 123,
        'OnDemandTargetCapacity': 123,
        'SpotTargetCapacity': 123,
        'DefaultTargetCapacityType': 'spot'|'on-demand'
    }
)
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 ExcessCapacityTerminationPolicy

string

param ExcessCapacityTerminationPolicy

Indicates whether running instances should be terminated if the total target capacity of the EC2 Fleet is decreased below the current size of the EC2 Fleet.

type FleetId

string

param FleetId

[REQUIRED]

The ID of the EC2 Fleet.

type TargetCapacitySpecification

dict

param TargetCapacitySpecification

[REQUIRED]

The size of the EC2 Fleet.

  • TotalTargetCapacity (integer) -- [REQUIRED]

    The number of units to request, filled using DefaultTargetCapacityType .

  • OnDemandTargetCapacity (integer) --

    The number of On-Demand units to request.

  • SpotTargetCapacity (integer) --

    The number of Spot units to request.

  • DefaultTargetCapacityType (string) --

    The default TotalTargetCapacity , which is either Spot or On-Demand .

rtype

dict

returns

Response Syntax

{
    'Return': True|False
}

Response Structure

  • (dict) --

    • Return (boolean) --

      Is true if the request succeeds, and an error otherwise.

DescribeFleets (new) Link ¶

Describes the specified EC2 Fleet.

See also: AWS API Documentation

Request Syntax

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

list

param FleetIds

The ID of the EC2 Fleets.

  • (string) --

type Filters

list

param Filters

One or more filters.

  • (dict) --

    A filter name and value pair that is used to return a more specific list of results from a describe operation. Filters can be used to match a set of resources by specific criteria, such as tags, attributes, or IDs. The filters supported by a describe operation are documented with the describe operation. For example:

    • DescribeAvailabilityZones

    • DescribeImages

    • DescribeInstances

    • DescribeKeyPairs

    • DescribeSecurityGroups

    • DescribeSnapshots

    • DescribeSubnets

    • DescribeTags

    • DescribeVolumes

    • DescribeVpcs

    • 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

{
    'NextToken': 'string',
    'Fleets': [
        {
            'ActivityStatus': 'error'|'pending-fulfillment'|'pending-termination'|'fulfilled',
            'CreateTime': datetime(2015, 1, 1),
            'FleetId': 'string',
            'FleetState': 'submitted'|'active'|'deleted'|'failed'|'deleted-running'|'deleted-terminating'|'modifying',
            'ClientToken': 'string',
            'ExcessCapacityTerminationPolicy': 'no-termination'|'termination',
            'FulfilledCapacity': 123.0,
            'FulfilledOnDemandCapacity': 123.0,
            'LaunchTemplateConfigs': [
                {
                    'LaunchTemplateSpecification': {
                        'LaunchTemplateId': 'string',
                        'LaunchTemplateName': 'string',
                        'Version': 'string'
                    },
                    'Overrides': [
                        {
                            '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'|'m5.large'|'m5.xlarge'|'m5.2xlarge'|'m5.4xlarge'|'m5.12xlarge'|'m5.24xlarge'|'h1.2xlarge'|'h1.4xlarge'|'h1.8xlarge'|'h1.16xlarge',
                            'MaxPrice': 'string',
                            'SubnetId': 'string',
                            'AvailabilityZone': 'string',
                            'WeightedCapacity': 123.0
                        },
                    ]
                },
            ],
            'TargetCapacitySpecification': {
                'TotalTargetCapacity': 123,
                'OnDemandTargetCapacity': 123,
                'SpotTargetCapacity': 123,
                'DefaultTargetCapacityType': 'spot'|'on-demand'
            },
            'TerminateInstancesWithExpiration': True|False,
            'Type': 'request'|'maintain',
            'ValidFrom': datetime(2015, 1, 1),
            'ValidUntil': datetime(2015, 1, 1),
            'ReplaceUnhealthyInstances': True|False,
            'SpotOptions': {
                'AllocationStrategy': 'lowest-price'|'diversified',
                'InstanceInterruptionBehavior': 'hibernate'|'stop'|'terminate'
            },
            'Tags': [
                {
                    'Key': 'string',
                    'Value': 'string'
                },
            ]
        },
    ]
}

Response Structure

  • (dict) --

    • NextToken (string) --

      The token for the next set of results.

    • Fleets (list) --

      The EC2 Fleets.

      • (dict) --

        Describes an EC2 Fleet.

        • ActivityStatus (string) --

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

        • CreateTime (datetime) --

          The creation date and time of the EC2 Fleet.

        • FleetId (string) --

          The ID of the EC2 Fleet.

        • FleetState (string) --

          The state of the EC2 Fleet.

        • ClientToken (string) --

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

          Constraints: Maximum 64 ASCII characters

        • ExcessCapacityTerminationPolicy (string) --

          Indicates whether running instances should be terminated if the target capacity of the EC2 Fleet is decreased below the current size of the EC2 Fleet.

        • FulfilledCapacity (float) --

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

        • FulfilledOnDemandCapacity (float) --

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

        • LaunchTemplateConfigs (list) --

          The launch template and overrides.

          • (dict) --

            Describes a launch template and overrides.

            • LaunchTemplateSpecification (dict) --

              The launch template.

              • LaunchTemplateId (string) --

                The ID of the launch template. You must specify either a template ID or a template name.

              • LaunchTemplateName (string) --

                The name of the launch template. You must specify either a template name or a template ID.

              • Version (string) --

                The version number. By default, the default version of the launch template is used.

            • Overrides (list) --

              Any parameters that you specify override the same parameters in the launch template.

              • (dict) --

                Describes overrides for a launch template.

                • InstanceType (string) --

                  The instance type.

                • MaxPrice (string) --

                  The maximum price per unit hour that you are willing to pay for a Spot Instance.

                • SubnetId (string) --

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

                • AvailabilityZone (string) --

                  The Availability Zone in which to launch the instances.

                • WeightedCapacity (float) --

                  The number of units provided by the specified instance type.

        • TargetCapacitySpecification (dict) --

          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. If the request type is maintain , you can specify a target capacity of 0 and add capacity later.

          • TotalTargetCapacity (integer) --

            The number of units to request, filled using DefaultTargetCapacityType .

          • OnDemandTargetCapacity (integer) --

            The number of On-Demand units to request.

          • SpotTargetCapacity (integer) --

            The maximum number of Spot units to launch.

          • DefaultTargetCapacityType (string) --

            The default TotalTargetCapacity , which is either Spot or On-Demand .

        • TerminateInstancesWithExpiration (boolean) --

          Indicates whether running instances should be terminated when the EC2 Fleet expires.

        • Type (string) --

          The type of request. Indicates whether the EC2 Fleet only requests the target capacity, or also attempts to maintain it. If you request a certain target capacity, EC2 Fleet only places the required requests; it does not attempt to replenish instances if capacity is diminished, and does not submit requests in alternative capacity pools if capacity is unavailable. To maintain a certain target capacity, EC2 Fleet places the required requests to meet this target capacity. It also automatically replenishes any interrupted Spot 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 instance requests are placed or able to fulfill the request. The default end date is 7 days from the current date.

        • ReplaceUnhealthyInstances (boolean) --

          Indicates whether EC2 Fleet should replace unhealthy instances.

        • SpotOptions (dict) --

          The configuration of Spot Instances in an EC2 Fleet.

          • AllocationStrategy (string) --

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

          • InstanceInterruptionBehavior (string) --

            The behavior when a Spot Instance is interrupted. The default is terminate .

        • Tags (list) --

          The tags for an EC2 Fleet 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.

CreateFleet (new) Link ¶

Launches an EC2 Fleet.

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

For more information, see Launching an EC2 Fleet in the Amazon Elastic Compute Cloud User Guide .

See also: AWS API Documentation

Request Syntax

client.create_fleet(
    DryRun=True|False,
    ClientToken='string',
    SpotOptions={
        'AllocationStrategy': 'lowest-price'|'diversified',
        'InstanceInterruptionBehavior': 'hibernate'|'stop'|'terminate'
    },
    ExcessCapacityTerminationPolicy='no-termination'|'termination',
    LaunchTemplateConfigs=[
        {
            'LaunchTemplateSpecification': {
                'LaunchTemplateId': 'string',
                'LaunchTemplateName': 'string',
                'Version': 'string'
            },
            'Overrides': [
                {
                    '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'|'m5.large'|'m5.xlarge'|'m5.2xlarge'|'m5.4xlarge'|'m5.12xlarge'|'m5.24xlarge'|'h1.2xlarge'|'h1.4xlarge'|'h1.8xlarge'|'h1.16xlarge',
                    'MaxPrice': 'string',
                    'SubnetId': 'string',
                    'AvailabilityZone': 'string',
                    'WeightedCapacity': 123.0
                },
            ]
        },
    ],
    TargetCapacitySpecification={
        'TotalTargetCapacity': 123,
        'OnDemandTargetCapacity': 123,
        'SpotTargetCapacity': 123,
        'DefaultTargetCapacityType': 'spot'|'on-demand'
    },
    TerminateInstancesWithExpiration=True|False,
    Type='request'|'maintain',
    ValidFrom=datetime(2015, 1, 1),
    ValidUntil=datetime(2015, 1, 1),
    ReplaceUnhealthyInstances=True|False,
    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 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 ClientToken

string

param ClientToken

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

type SpotOptions

dict

param SpotOptions

Includes SpotAllocationStrategy and SpotInstanceInterruptionBehavior inside this structure.

  • AllocationStrategy (string) --

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

  • InstanceInterruptionBehavior (string) --

    The behavior when a Spot Instance is interrupted. The default is terminate .

type ExcessCapacityTerminationPolicy

string

param ExcessCapacityTerminationPolicy

Indicates whether running instances should be terminated if the total target capacity of the EC2 Fleet is decreased below the current size of the EC2 Fleet.

type LaunchTemplateConfigs

list

param LaunchTemplateConfigs

[REQUIRED]

The configuration for the EC2 Fleet.

  • (dict) --

    Describes a launch template and overrides.

    • LaunchTemplateSpecification (dict) --

      The launch template to use. You must specify either the launch template ID or launch template name in the request.

      • LaunchTemplateId (string) --

        The ID of the launch template.

      • LaunchTemplateName (string) --

        The name of the launch template.

      • Version (string) --

        The version number of the launch template.

    • Overrides (list) --

      Any parameters that you specify override the same parameters in the launch template.

      • (dict) --

        Describes overrides for a launch template.

        • InstanceType (string) --

          The instance type.

        • MaxPrice (string) --

          The maximum price per unit hour that you are willing to pay for a Spot Instance.

        • SubnetId (string) --

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

        • AvailabilityZone (string) --

          The Availability Zone in which to launch the instances.

        • WeightedCapacity (float) --

          The number of units provided by the specified instance type.

type TargetCapacitySpecification

dict

param TargetCapacitySpecification

[REQUIRED]

The TotalTargetCapacity , OnDemandTargetCapacity , SpotTargetCapacity , and DefaultCapacityType structure.

  • TotalTargetCapacity (integer) -- [REQUIRED]

    The number of units to request, filled using DefaultTargetCapacityType .

  • OnDemandTargetCapacity (integer) --

    The number of On-Demand units to request.

  • SpotTargetCapacity (integer) --

    The number of Spot units to request.

  • DefaultTargetCapacityType (string) --

    The default TotalTargetCapacity , which is either Spot or On-Demand .

type TerminateInstancesWithExpiration

boolean

param TerminateInstancesWithExpiration

Indicates whether running instances should be terminated when the EC2 Fleet expires.

type Type

string

param Type

The type of request. Indicates whether the EC2 Fleet only requests the target capacity, or also attempts to maintain it. If you request a certain target capacity, EC2 Fleet only places the required requests. It does not attempt to replenish instances if capacity is diminished, and does not submit requests in alternative capacity pools if capacity is unavailable. To maintain a certain target capacity, EC2 Fleet places the required requests to meet this target capacity. It also automatically replenishes any interrupted Spot Instances. Default: maintain .

type ValidFrom

datetime

param ValidFrom

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.

type ValidUntil

datetime

param ValidUntil

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 EC2 Fleet requests are placed or able to fulfill the request. The default end date is 7 days from the current date.

type ReplaceUnhealthyInstances

boolean

param ReplaceUnhealthyInstances

Indicates whether EC2 Fleet should replace unhealthy instances.

type TagSpecifications

list

param TagSpecifications

The tags for an EC2 Fleet resource.

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

{
    'FleetId': 'string'
}

Response Structure

  • (dict) --

    • FleetId (string) --

      The ID of the EC2 Fleet.

DeleteFleets (new) Link ¶

Deletes the specified EC2 Fleet.

After you delete an EC2 Fleet, the EC2 Fleet launches no new instances. You must specify whether the EC2 Fleet should also terminate its instances. If you terminate the instances, the EC2 Fleet enters the deleted_terminating state. Otherwise, the EC2 Fleet enters the deleted_running state, and the instances continue to run until they are interrupted or you terminate them manually.

See also: AWS API Documentation

Request Syntax

client.delete_fleets(
    DryRun=True|False,
    FleetIds=[
        'string',
    ],
    TerminateInstances=True|False
)
type DryRun

boolean

param DryRun

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

type FleetIds

list

param FleetIds

[REQUIRED]

The IDs of the EC2 Fleets.

  • (string) --

type TerminateInstances

boolean

param TerminateInstances

[REQUIRED]

Indicates whether to terminate instances for an EC2 Fleet if it is deleted successfully.

rtype

dict

returns

Response Syntax

{
    'SuccessfulFleetDeletions': [
        {
            'CurrentFleetState': 'submitted'|'active'|'deleted'|'failed'|'deleted-running'|'deleted-terminating'|'modifying',
            'PreviousFleetState': 'submitted'|'active'|'deleted'|'failed'|'deleted-running'|'deleted-terminating'|'modifying',
            'FleetId': 'string'
        },
    ],
    'UnsuccessfulFleetDeletions': [
        {
            'Error': {
                'Code': 'fleetIdDoesNotExist'|'fleetIdMalformed'|'fleetNotInDeletableState'|'unexpectedError',
                'Message': 'string'
            },
            'FleetId': 'string'
        },
    ]
}

Response Structure

  • (dict) --

    • SuccessfulFleetDeletions (list) --

      Information about the EC2 Fleets that are successfully deleted.

      • (dict) --

        Describes an EC2 Fleet that was successfully deleted.

        • CurrentFleetState (string) --

          The current state of the EC2 Fleet.

        • PreviousFleetState (string) --

          The previous state of the EC2 Fleet.

        • FleetId (string) --

          The ID of the EC2 Fleet.

    • UnsuccessfulFleetDeletions (list) --

      Information about the EC2 Fleets that are not successfully deleted.

      • (dict) --

        Describes an EC2 Fleet that was not successfully deleted.

        • Error (dict) --

          The error.

          • Code (string) --

            The error code.

          • Message (string) --

            The description for the error code.

        • FleetId (string) --

          The ID of the EC2 Fleet.

DescribeSpotFleetRequests (updated) Link ¶
Changes (response)
{'SpotFleetRequestConfigs': {'SpotFleetRequestConfig': {'OnDemandFulfilledCapacity': 'double',
                                                        'OnDemandTargetCapacity': 'integer'}}}

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,
                'OnDemandFulfilledCapacity': 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,
                                    'KmsKeyId': 'string',
                                    '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'|'m5.large'|'m5.xlarge'|'m5.2xlarge'|'m5.4xlarge'|'m5.12xlarge'|'m5.24xlarge'|'h1.2xlarge'|'h1.4xlarge'|'h1.8xlarge'|'h1.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'
                                    },
                                ]
                            },
                        ]
                    },
                ],
                'LaunchTemplateConfigs': [
                    {
                        'LaunchTemplateSpecification': {
                            'LaunchTemplateId': 'string',
                            'LaunchTemplateName': 'string',
                            'Version': 'string'
                        },
                        'Overrides': [
                            {
                                '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'|'m5.large'|'m5.xlarge'|'m5.2xlarge'|'m5.4xlarge'|'m5.12xlarge'|'m5.24xlarge'|'h1.2xlarge'|'h1.4xlarge'|'h1.8xlarge'|'h1.16xlarge',
                                'SpotPrice': 'string',
                                'SubnetId': 'string',
                                'AvailabilityZone': 'string',
                                'WeightedCapacity': 123.0
                            },
                        ]
                    },
                ],
                'SpotPrice': 'string',
                'TargetCapacity': 123,
                'OnDemandTargetCapacity': 123,
                'TerminateInstancesWithExpiration': True|False,
                'Type': 'request'|'maintain',
                'ValidFrom': datetime(2015, 1, 1),
                'ValidUntil': datetime(2015, 1, 1),
                'ReplaceUnhealthyInstances': True|False,
                'InstanceInterruptionBehavior': 'hibernate'|'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 requests 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) --

          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 that you provide to ensure the idempotency of your listings. This helps to 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.

          • OnDemandFulfilledCapacity (float) --

            The number of On-Demand units fulfilled by this request compared to the set target On-Demand 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) --

            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.

                    • KmsKeyId (string) --

                      Identifier (key ID, key alias, ID ARN, or alias ARN) for a user-managed CMK under which the EBS volume is encrypted.

                      Note: This parameter is only supported on BlockDeviceMapping objects called by RunInstances, RequestSpotFleet, and RequestSpotInstances.

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

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

                • 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 maximum price per unit hour that you are willing to pay for a Spot Instance. If this value is not specified, the default is the Spot price specified for the fleet. To determine the Spot price per unit hour, divide the Spot 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 Base64-encoded user data to make available to the instances.

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

          • LaunchTemplateConfigs (list) --

            The launch template and overrides.

            • (dict) --

              Describes a launch template and overrides.

              • LaunchTemplateSpecification (dict) --

                The launch template.

                • LaunchTemplateId (string) --

                  The ID of the launch template. You must specify either a template ID or a template name.

                • LaunchTemplateName (string) --

                  The name of the launch template. You must specify either a template name or a template ID.

                • Version (string) --

                  The version number. By default, the default version of the launch template is used.

              • Overrides (list) --

                Any parameters that you specify override the same parameters in the launch template.

                • (dict) --

                  Describes overrides for a launch template.

                  • InstanceType (string) --

                    The instance type.

                  • SpotPrice (string) --

                    The maximum price per unit hour that you are willing to pay for a Spot Instance.

                  • SubnetId (string) --

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

                  • AvailabilityZone (string) --

                    The Availability Zone in which to launch the instances.

                  • WeightedCapacity (float) --

                    The number of units provided by the specified instance type.

          • SpotPrice (string) --

            The maximum price per unit hour that you are willing to pay for a Spot Instance. The default is the On-Demand price.

          • 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. If the request type is maintain , you can specify a target capacity of 0 and add capacity later.

          • OnDemandTargetCapacity (integer) --

            The number of On-Demand 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. If the request type is maintain , you can specify a target capacity of 0 and add capacity later.

          • 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 Spot Fleet only requests the target capacity or also attempts to maintain it. When this value is request , the Spot Fleet only places the required requests. It does not attempt to replenish Spot Instances if capacity is diminished, nor does it submit requests in alternative Spot pools if capacity is not available. To maintain a certain target capacity, the Spot Fleet places the required requests to meet capacity and automatically replenishes 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 able to fulfill the request. The default end date is 7 days from the current date.

          • ReplaceUnhealthyInstances (boolean) --

            Indicates whether Spot Fleet should replace unhealthy instances.

          • InstanceInterruptionBehavior (string) --

            The behavior when a Spot Instance is interrupted. The default is terminate .

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

RequestSpotFleet (updated) Link ¶
Changes (request)
{'SpotFleetRequestConfig': {'OnDemandFulfilledCapacity': 'double',
                            'OnDemandTargetCapacity': 'integer'}}

Creates a Spot Fleet request.

The Spot Fleet request specifies the total target capacity and the On-Demand target capacity. Amazon EC2 calculates the difference between the total capacity and On-Demand capacity, and launches the difference as Spot capacity.

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.

You can specify tags for the Spot Instances. You cannot tag other resource types in a Spot Fleet request because only the instance resource type is supported.

For more information, see Spot Fleet Requests in the Amazon EC2 User Guide for Linux Instances .

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,
        'OnDemandFulfilledCapacity': 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,
                            'KmsKeyId': 'string',
                            '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'|'m5.large'|'m5.xlarge'|'m5.2xlarge'|'m5.4xlarge'|'m5.12xlarge'|'m5.24xlarge'|'h1.2xlarge'|'h1.4xlarge'|'h1.8xlarge'|'h1.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'
                            },
                        ]
                    },
                ]
            },
        ],
        'LaunchTemplateConfigs': [
            {
                'LaunchTemplateSpecification': {
                    'LaunchTemplateId': 'string',
                    'LaunchTemplateName': 'string',
                    'Version': 'string'
                },
                'Overrides': [
                    {
                        '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'|'m5.large'|'m5.xlarge'|'m5.2xlarge'|'m5.4xlarge'|'m5.12xlarge'|'m5.24xlarge'|'h1.2xlarge'|'h1.4xlarge'|'h1.8xlarge'|'h1.16xlarge',
                        'SpotPrice': 'string',
                        'SubnetId': 'string',
                        'AvailabilityZone': 'string',
                        'WeightedCapacity': 123.0
                    },
                ]
            },
        ],
        'SpotPrice': 'string',
        'TargetCapacity': 123,
        'OnDemandTargetCapacity': 123,
        'TerminateInstancesWithExpiration': True|False,
        'Type': 'request'|'maintain',
        'ValidFrom': datetime(2015, 1, 1),
        'ValidUntil': datetime(2015, 1, 1),
        'ReplaceUnhealthyInstances': True|False,
        'InstanceInterruptionBehavior': 'hibernate'|'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 that you provide to ensure the idempotency of your listings. This helps to 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.

  • OnDemandFulfilledCapacity (float) --

    The number of On-Demand units fulfilled by this request compared to the set target On-Demand 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) --

    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.

            • KmsKeyId (string) --

              Identifier (key ID, key alias, ID ARN, or alias ARN) for a user-managed CMK under which the EBS volume is encrypted.

              Note: This parameter is only supported on BlockDeviceMapping objects called by RunInstances, RequestSpotFleet, and RequestSpotInstances.

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

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

        • 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 maximum price per unit hour that you are willing to pay for a Spot Instance. If this value is not specified, the default is the Spot price specified for the fleet. To determine the Spot price per unit hour, divide the Spot 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 Base64-encoded user data to make available to the instances.

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

  • LaunchTemplateConfigs (list) --

    The launch template and overrides.

    • (dict) --

      Describes a launch template and overrides.

      • LaunchTemplateSpecification (dict) --

        The launch template.

        • LaunchTemplateId (string) --

          The ID of the launch template. You must specify either a template ID or a template name.

        • LaunchTemplateName (string) --

          The name of the launch template. You must specify either a template name or a template ID.

        • Version (string) --

          The version number. By default, the default version of the launch template is used.

      • Overrides (list) --

        Any parameters that you specify override the same parameters in the launch template.

        • (dict) --

          Describes overrides for a launch template.

          • InstanceType (string) --

            The instance type.

          • SpotPrice (string) --

            The maximum price per unit hour that you are willing to pay for a Spot Instance.

          • SubnetId (string) --

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

          • AvailabilityZone (string) --

            The Availability Zone in which to launch the instances.

          • WeightedCapacity (float) --

            The number of units provided by the specified instance type.

  • SpotPrice (string) --

    The maximum price per unit hour that you are willing to pay for a Spot Instance. The default is the On-Demand price.

  • 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. If the request type is maintain , you can specify a target capacity of 0 and add capacity later.

  • OnDemandTargetCapacity (integer) --

    The number of On-Demand 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. If the request type is maintain , you can specify a target capacity of 0 and add capacity later.

  • 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 Spot Fleet only requests the target capacity or also attempts to maintain it. When this value is request , the Spot Fleet only places the required requests. It does not attempt to replenish Spot Instances if capacity is diminished, nor does it submit requests in alternative Spot pools if capacity is not available. To maintain a certain target capacity, the Spot Fleet places the required requests to meet capacity and automatically replenishes 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 able to fulfill the request. The default end date is 7 days from the current date.

  • ReplaceUnhealthyInstances (boolean) --

    Indicates whether Spot Fleet should replace unhealthy instances.

  • InstanceInterruptionBehavior (string) --

    The behavior when a Spot Instance is interrupted. The default is terminate .

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