amazonka-ec2-2.0: Amazon Elastic Compute Cloud SDK.
Copyright(c) 2013-2023 Brendan Hay
LicenseMozilla Public License, v. 2.0.
MaintainerBrendan Hay
Stabilityauto-generated
Portabilitynon-portable (GHC extensions)
Safe HaskellSafe-Inferred
LanguageHaskell2010

Amazonka.EC2.RequestSpotInstances

Description

Creates a Spot Instance request.

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

We strongly discourage using the RequestSpotInstances API because it is a legacy API with no planned investment. For options for requesting Spot Instances, see Which is the best Spot request method to use? in the Amazon EC2 User Guide for Linux Instances.

We are retiring EC2-Classic. We recommend that you migrate from EC2-Classic to a VPC. For more information, see Migrate from EC2-Classic to a VPC in the Amazon EC2 User Guide for Linux Instances.

Synopsis

Creating a Request

data RequestSpotInstances Source #

Contains the parameters for RequestSpotInstances.

See: newRequestSpotInstances smart constructor.

Constructors

RequestSpotInstances' 

Fields

  • availabilityZoneGroup :: Maybe Text

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

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

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

    Default: Instances are launched in any available Availability Zone.

  • blockDurationMinutes :: Maybe Int

    Deprecated.

  • clientToken :: Maybe Text

    Unique, case-sensitive identifier that you provide to ensure the idempotency of the request. For more information, see How to Ensure Idempotency in the Amazon EC2 User Guide for Linux Instances.

  • dryRun :: Maybe Bool

    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.

  • instanceCount :: Maybe Int

    The maximum number of Spot Instances to launch.

    Default: 1

  • instanceInterruptionBehavior :: Maybe InstanceInterruptionBehavior

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

  • launchGroup :: Maybe Text

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

    Default: Instances are launched and terminated individually

  • launchSpecification :: Maybe RequestSpotLaunchSpecification

    The launch specification.

  • spotPrice :: Maybe Text

    The maximum price per unit hour that you are willing to pay for a Spot Instance. We do not recommend using this parameter because it can lead to increased interruptions. If you do not specify this parameter, you will pay the current Spot price.

    If you specify a maximum price, your instances will be interrupted more frequently than if you do not specify this parameter.

  • tagSpecifications :: Maybe [TagSpecification]

    The key-value pair for tagging the Spot Instance request on creation. The value for ResourceType must be spot-instances-request, otherwise the Spot Instance request fails. To tag the Spot Instance request after it has been created, see CreateTags.

  • type' :: Maybe SpotInstanceType

    The Spot Instance request type.

    Default: one-time

  • validFrom :: Maybe ISO8601

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

    The specified start date and time cannot be equal to the current date and time. You must specify a start date and time that occurs after the current date and time.

  • validUntil :: Maybe ISO8601

    The end date of the request, in UTC format (YYYY-MM-DDTHH:MM:SSZ).

    • For a persistent request, the request remains active until the ValidUntil date and time is reached. Otherwise, the request remains active until you cancel it.
    • For a one-time request, the request remains active until all instances launch, the request is canceled, or the ValidUntil date and time is reached. By default, the request is valid for 7 days from the date the request was created.

Instances

Instances details
ToHeaders RequestSpotInstances Source # 
Instance details

Defined in Amazonka.EC2.RequestSpotInstances

ToPath RequestSpotInstances Source # 
Instance details

Defined in Amazonka.EC2.RequestSpotInstances

ToQuery RequestSpotInstances Source # 
Instance details

Defined in Amazonka.EC2.RequestSpotInstances

AWSRequest RequestSpotInstances Source # 
Instance details

Defined in Amazonka.EC2.RequestSpotInstances

Associated Types

type AWSResponse RequestSpotInstances #

Generic RequestSpotInstances Source # 
Instance details

Defined in Amazonka.EC2.RequestSpotInstances

Associated Types

type Rep RequestSpotInstances :: Type -> Type #

Read RequestSpotInstances Source # 
Instance details

Defined in Amazonka.EC2.RequestSpotInstances

Show RequestSpotInstances Source # 
Instance details

Defined in Amazonka.EC2.RequestSpotInstances

NFData RequestSpotInstances Source # 
Instance details

Defined in Amazonka.EC2.RequestSpotInstances

Methods

rnf :: RequestSpotInstances -> () #

Eq RequestSpotInstances Source # 
Instance details

Defined in Amazonka.EC2.RequestSpotInstances

Hashable RequestSpotInstances Source # 
Instance details

Defined in Amazonka.EC2.RequestSpotInstances

type AWSResponse RequestSpotInstances Source # 
Instance details

Defined in Amazonka.EC2.RequestSpotInstances

type Rep RequestSpotInstances Source # 
Instance details

Defined in Amazonka.EC2.RequestSpotInstances

type Rep RequestSpotInstances = D1 ('MetaData "RequestSpotInstances" "Amazonka.EC2.RequestSpotInstances" "amazonka-ec2-2.0-48L9RAJvmvzAdBkRegqWCL" 'False) (C1 ('MetaCons "RequestSpotInstances'" 'PrefixI 'True) (((S1 ('MetaSel ('Just "availabilityZoneGroup") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Text)) :*: (S1 ('MetaSel ('Just "blockDurationMinutes") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Int)) :*: S1 ('MetaSel ('Just "clientToken") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Text)))) :*: (S1 ('MetaSel ('Just "dryRun") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Bool)) :*: (S1 ('MetaSel ('Just "instanceCount") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Int)) :*: S1 ('MetaSel ('Just "instanceInterruptionBehavior") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe InstanceInterruptionBehavior))))) :*: ((S1 ('MetaSel ('Just "launchGroup") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Text)) :*: (S1 ('MetaSel ('Just "launchSpecification") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe RequestSpotLaunchSpecification)) :*: S1 ('MetaSel ('Just "spotPrice") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Text)))) :*: ((S1 ('MetaSel ('Just "tagSpecifications") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe [TagSpecification])) :*: S1 ('MetaSel ('Just "type'") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe SpotInstanceType))) :*: (S1 ('MetaSel ('Just "validFrom") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe ISO8601)) :*: S1 ('MetaSel ('Just "validUntil") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe ISO8601)))))))

newRequestSpotInstances :: RequestSpotInstances Source #

Create a value of RequestSpotInstances with all optional fields omitted.

Use generic-lens or optics to modify other optional fields.

The following record fields are available, with the corresponding lenses provided for backwards compatibility:

RequestSpotInstances, requestSpotInstances_availabilityZoneGroup - The user-specified name for a logical grouping of requests.

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

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

Default: Instances are launched in any available Availability Zone.

RequestSpotInstances, requestSpotInstances_blockDurationMinutes - Deprecated.

RequestSpotInstances, requestSpotInstances_clientToken - Unique, case-sensitive identifier that you provide to ensure the idempotency of the request. For more information, see How to Ensure Idempotency in the Amazon EC2 User Guide for Linux Instances.

$sel:dryRun:RequestSpotInstances', requestSpotInstances_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.

RequestSpotInstances, requestSpotInstances_instanceCount - The maximum number of Spot Instances to launch.

Default: 1

RequestSpotInstances, requestSpotInstances_instanceInterruptionBehavior - The behavior when a Spot Instance is interrupted. The default is terminate.

RequestSpotInstances, requestSpotInstances_launchGroup - The instance launch group. Launch groups are Spot Instances that launch together and terminate together.

Default: Instances are launched and terminated individually

RequestSpotInstances, requestSpotInstances_launchSpecification - The launch specification.

RequestSpotInstances, requestSpotInstances_spotPrice - The maximum price per unit hour that you are willing to pay for a Spot Instance. We do not recommend using this parameter because it can lead to increased interruptions. If you do not specify this parameter, you will pay the current Spot price.

If you specify a maximum price, your instances will be interrupted more frequently than if you do not specify this parameter.

RequestSpotInstances, requestSpotInstances_tagSpecifications - The key-value pair for tagging the Spot Instance request on creation. The value for ResourceType must be spot-instances-request, otherwise the Spot Instance request fails. To tag the Spot Instance request after it has been created, see CreateTags.

RequestSpotInstances, requestSpotInstances_type - The Spot Instance request type.

Default: one-time

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

The specified start date and time cannot be equal to the current date and time. You must specify a start date and time that occurs after the current date and time.

RequestSpotInstances, requestSpotInstances_validUntil - The end date of the request, in UTC format (YYYY-MM-DDTHH:MM:SSZ).

  • For a persistent request, the request remains active until the ValidUntil date and time is reached. Otherwise, the request remains active until you cancel it.
  • For a one-time request, the request remains active until all instances launch, the request is canceled, or the ValidUntil date and time is reached. By default, the request is valid for 7 days from the date the request was created.

Request Lenses

requestSpotInstances_availabilityZoneGroup :: Lens' RequestSpotInstances (Maybe Text) Source #

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

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

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

Default: Instances are launched in any available Availability Zone.

requestSpotInstances_clientToken :: Lens' RequestSpotInstances (Maybe Text) Source #

Unique, case-sensitive identifier that you provide to ensure the idempotency of the request. For more information, see How to Ensure Idempotency in the Amazon EC2 User Guide for Linux Instances.

requestSpotInstances_dryRun :: Lens' RequestSpotInstances (Maybe Bool) Source #

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.

requestSpotInstances_instanceCount :: Lens' RequestSpotInstances (Maybe Int) Source #

The maximum number of Spot Instances to launch.

Default: 1

requestSpotInstances_instanceInterruptionBehavior :: Lens' RequestSpotInstances (Maybe InstanceInterruptionBehavior) Source #

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

requestSpotInstances_launchGroup :: Lens' RequestSpotInstances (Maybe Text) Source #

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

Default: Instances are launched and terminated individually

requestSpotInstances_spotPrice :: Lens' RequestSpotInstances (Maybe Text) Source #

The maximum price per unit hour that you are willing to pay for a Spot Instance. We do not recommend using this parameter because it can lead to increased interruptions. If you do not specify this parameter, you will pay the current Spot price.

If you specify a maximum price, your instances will be interrupted more frequently than if you do not specify this parameter.

requestSpotInstances_tagSpecifications :: Lens' RequestSpotInstances (Maybe [TagSpecification]) Source #

The key-value pair for tagging the Spot Instance request on creation. The value for ResourceType must be spot-instances-request, otherwise the Spot Instance request fails. To tag the Spot Instance request after it has been created, see CreateTags.

requestSpotInstances_type :: Lens' RequestSpotInstances (Maybe SpotInstanceType) Source #

The Spot Instance request type.

Default: one-time

requestSpotInstances_validFrom :: Lens' RequestSpotInstances (Maybe UTCTime) Source #

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

The specified start date and time cannot be equal to the current date and time. You must specify a start date and time that occurs after the current date and time.

requestSpotInstances_validUntil :: Lens' RequestSpotInstances (Maybe UTCTime) Source #

The end date of the request, in UTC format (YYYY-MM-DDTHH:MM:SSZ).

  • For a persistent request, the request remains active until the ValidUntil date and time is reached. Otherwise, the request remains active until you cancel it.
  • For a one-time request, the request remains active until all instances launch, the request is canceled, or the ValidUntil date and time is reached. By default, the request is valid for 7 days from the date the request was created.

Destructuring the Response

data RequestSpotInstancesResponse Source #

Contains the output of RequestSpotInstances.

See: newRequestSpotInstancesResponse smart constructor.

Constructors

RequestSpotInstancesResponse' 

Fields

Instances

Instances details
Generic RequestSpotInstancesResponse Source # 
Instance details

Defined in Amazonka.EC2.RequestSpotInstances

Associated Types

type Rep RequestSpotInstancesResponse :: Type -> Type #

Read RequestSpotInstancesResponse Source # 
Instance details

Defined in Amazonka.EC2.RequestSpotInstances

Show RequestSpotInstancesResponse Source # 
Instance details

Defined in Amazonka.EC2.RequestSpotInstances

NFData RequestSpotInstancesResponse Source # 
Instance details

Defined in Amazonka.EC2.RequestSpotInstances

Eq RequestSpotInstancesResponse Source # 
Instance details

Defined in Amazonka.EC2.RequestSpotInstances

type Rep RequestSpotInstancesResponse Source # 
Instance details

Defined in Amazonka.EC2.RequestSpotInstances

type Rep RequestSpotInstancesResponse = D1 ('MetaData "RequestSpotInstancesResponse" "Amazonka.EC2.RequestSpotInstances" "amazonka-ec2-2.0-48L9RAJvmvzAdBkRegqWCL" 'False) (C1 ('MetaCons "RequestSpotInstancesResponse'" 'PrefixI 'True) (S1 ('MetaSel ('Just "spotInstanceRequests") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe [SpotInstanceRequest])) :*: S1 ('MetaSel ('Just "httpStatus") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Int)))

newRequestSpotInstancesResponse Source #

Create a value of RequestSpotInstancesResponse with all optional fields omitted.

Use generic-lens or optics to modify other optional fields.

The following record fields are available, with the corresponding lenses provided for backwards compatibility:

$sel:spotInstanceRequests:RequestSpotInstancesResponse', requestSpotInstancesResponse_spotInstanceRequests - One or more Spot Instance requests.

$sel:httpStatus:RequestSpotInstancesResponse', requestSpotInstancesResponse_httpStatus - The response's http status code.

Response Lenses