Copyright | (c) 2013-2023 Brendan Hay |
---|---|
License | Mozilla Public License, v. 2.0. |
Maintainer | Brendan Hay |
Stability | auto-generated |
Portability | non-portable (GHC extensions) |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
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
- data RequestSpotInstances = RequestSpotInstances' {
- availabilityZoneGroup :: Maybe Text
- blockDurationMinutes :: Maybe Int
- clientToken :: Maybe Text
- dryRun :: Maybe Bool
- instanceCount :: Maybe Int
- instanceInterruptionBehavior :: Maybe InstanceInterruptionBehavior
- launchGroup :: Maybe Text
- launchSpecification :: Maybe RequestSpotLaunchSpecification
- spotPrice :: Maybe Text
- tagSpecifications :: Maybe [TagSpecification]
- type' :: Maybe SpotInstanceType
- validFrom :: Maybe ISO8601
- validUntil :: Maybe ISO8601
- newRequestSpotInstances :: RequestSpotInstances
- requestSpotInstances_availabilityZoneGroup :: Lens' RequestSpotInstances (Maybe Text)
- requestSpotInstances_blockDurationMinutes :: Lens' RequestSpotInstances (Maybe Int)
- requestSpotInstances_clientToken :: Lens' RequestSpotInstances (Maybe Text)
- requestSpotInstances_dryRun :: Lens' RequestSpotInstances (Maybe Bool)
- requestSpotInstances_instanceCount :: Lens' RequestSpotInstances (Maybe Int)
- requestSpotInstances_instanceInterruptionBehavior :: Lens' RequestSpotInstances (Maybe InstanceInterruptionBehavior)
- requestSpotInstances_launchGroup :: Lens' RequestSpotInstances (Maybe Text)
- requestSpotInstances_launchSpecification :: Lens' RequestSpotInstances (Maybe RequestSpotLaunchSpecification)
- requestSpotInstances_spotPrice :: Lens' RequestSpotInstances (Maybe Text)
- requestSpotInstances_tagSpecifications :: Lens' RequestSpotInstances (Maybe [TagSpecification])
- requestSpotInstances_type :: Lens' RequestSpotInstances (Maybe SpotInstanceType)
- requestSpotInstances_validFrom :: Lens' RequestSpotInstances (Maybe UTCTime)
- requestSpotInstances_validUntil :: Lens' RequestSpotInstances (Maybe UTCTime)
- data RequestSpotInstancesResponse = RequestSpotInstancesResponse' {}
- newRequestSpotInstancesResponse :: Int -> RequestSpotInstancesResponse
- requestSpotInstancesResponse_spotInstanceRequests :: Lens' RequestSpotInstancesResponse (Maybe [SpotInstanceRequest])
- requestSpotInstancesResponse_httpStatus :: Lens' RequestSpotInstancesResponse Int
Creating a Request
data RequestSpotInstances Source #
Contains the parameters for RequestSpotInstances.
See: newRequestSpotInstances
smart constructor.
RequestSpotInstances' | |
|
Instances
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_blockDurationMinutes :: Lens' RequestSpotInstances (Maybe Int) Source #
Deprecated.
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_launchSpecification :: Lens' RequestSpotInstances (Maybe RequestSpotLaunchSpecification) Source #
The launch specification.
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.
RequestSpotInstancesResponse' | |
|
Instances
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
requestSpotInstancesResponse_spotInstanceRequests :: Lens' RequestSpotInstancesResponse (Maybe [SpotInstanceRequest]) Source #
One or more Spot Instance requests.
requestSpotInstancesResponse_httpStatus :: Lens' RequestSpotInstancesResponse Int Source #
The response's http status code.