amazonka-ec2-1.6.0: Amazon Elastic Compute Cloud SDK.

Copyright(c) 2013-2018 Brendan Hay
LicenseMozilla Public License, v. 2.0.
MaintainerBrendan Hay <brendan.g.hay+amazonka@gmail.com>
Stabilityauto-generated
Portabilitynon-portable (GHC extensions)
Safe HaskellNone
LanguageHaskell2010

Network.AWS.EC2.RequestSpotInstances

Contents

Description

Creates a Spot Instance request. Spot Instances are instances that Amazon EC2 launches when the maximum price that you specify exceeds the current Spot price. For more information, see Spot Instance Requests in the Amazon EC2 User Guide for Linux Instances .

Synopsis

Creating a Request

requestSpotInstances :: RequestSpotInstances Source #

Creates a value of RequestSpotInstances with the minimum fields required to make a request.

Use one of the following lenses to modify other fields as desired:

  • rBlockDurationMinutes - The required duration for the Spot Instances (also known as Spot blocks), in minutes. This value must be a multiple of 60 (60, 120, 180, 240, 300, or 360). The duration period starts as soon as your Spot Instance receives its instance ID. At the end of the duration period, Amazon EC2 marks the Spot Instance for termination and provides a Spot Instance termination notice, which gives the instance a two-minute warning before it terminates. You can't specify an Availability Zone group or a launch group if you specify a duration.
  • rClientToken - 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 .
  • rInstanceCount - The maximum number of Spot Instances to launch. Default: 1
  • rInstanceInterruptionBehavior - The behavior when a Spot Instance is interrupted. The default is terminate .
  • rSpotPrice - The maximum price per hour that you are willing to pay for a Spot Instance. The default is the On-Demand price.
  • rLaunchSpecification - The launch specification.
  • rAvailabilityZoneGroup - 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.
  • rValidUntil - The end date of the request. If this is a one-time request, the request remains active until all instances launch, the request is canceled, or this date is reached. If the request is persistent, it remains active until it is canceled or this date is reached. The default end date is 7 days from the current date.
  • rLaunchGroup - The instance launch group. Launch groups are Spot Instances that launch together and terminate together. Default: Instances are launched and terminated individually
  • rType - The Spot Instance request type. Default: one-time
  • rValidFrom - 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.
  • rDryRun - 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 .

data RequestSpotInstances Source #

Contains the parameters for RequestSpotInstances.

See: requestSpotInstances smart constructor.

Instances

Eq RequestSpotInstances Source # 
Data RequestSpotInstances Source # 

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> RequestSpotInstances -> c RequestSpotInstances #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c RequestSpotInstances #

toConstr :: RequestSpotInstances -> Constr #

dataTypeOf :: RequestSpotInstances -> DataType #

dataCast1 :: Typeable (* -> *) t => (forall d. Data d => c (t d)) -> Maybe (c RequestSpotInstances) #

dataCast2 :: Typeable (* -> * -> *) t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c RequestSpotInstances) #

gmapT :: (forall b. Data b => b -> b) -> RequestSpotInstances -> RequestSpotInstances #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> RequestSpotInstances -> r #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> RequestSpotInstances -> r #

gmapQ :: (forall d. Data d => d -> u) -> RequestSpotInstances -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> RequestSpotInstances -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> RequestSpotInstances -> m RequestSpotInstances #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> RequestSpotInstances -> m RequestSpotInstances #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> RequestSpotInstances -> m RequestSpotInstances #

Read RequestSpotInstances Source # 
Show RequestSpotInstances Source # 
Generic RequestSpotInstances Source # 
Hashable RequestSpotInstances Source # 
NFData RequestSpotInstances Source # 

Methods

rnf :: RequestSpotInstances -> () #

AWSRequest RequestSpotInstances Source # 
ToHeaders RequestSpotInstances Source # 
ToPath RequestSpotInstances Source # 
ToQuery RequestSpotInstances Source # 
type Rep RequestSpotInstances Source # 
type Rep RequestSpotInstances = D1 * (MetaData "RequestSpotInstances" "Network.AWS.EC2.RequestSpotInstances" "amazonka-ec2-1.6.0-Kkew7Kpgof6EYi20Z0WOzs" False) (C1 * (MetaCons "RequestSpotInstances'" PrefixI True) ((:*:) * ((:*:) * ((:*:) * (S1 * (MetaSel (Just Symbol "_rBlockDurationMinutes") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 * (Maybe Int))) ((:*:) * (S1 * (MetaSel (Just Symbol "_rClientToken") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 * (Maybe Text))) (S1 * (MetaSel (Just Symbol "_rInstanceCount") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 * (Maybe Int))))) ((:*:) * (S1 * (MetaSel (Just Symbol "_rInstanceInterruptionBehavior") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 * (Maybe InstanceInterruptionBehavior))) ((:*:) * (S1 * (MetaSel (Just Symbol "_rSpotPrice") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 * (Maybe Text))) (S1 * (MetaSel (Just Symbol "_rLaunchSpecification") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 * (Maybe RequestSpotLaunchSpecification)))))) ((:*:) * ((:*:) * (S1 * (MetaSel (Just Symbol "_rAvailabilityZoneGroup") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 * (Maybe Text))) ((:*:) * (S1 * (MetaSel (Just Symbol "_rValidUntil") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 * (Maybe ISO8601))) (S1 * (MetaSel (Just Symbol "_rLaunchGroup") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 * (Maybe Text))))) ((:*:) * (S1 * (MetaSel (Just Symbol "_rType") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 * (Maybe SpotInstanceType))) ((:*:) * (S1 * (MetaSel (Just Symbol "_rValidFrom") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 * (Maybe ISO8601))) (S1 * (MetaSel (Just Symbol "_rDryRun") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 * (Maybe Bool))))))))
type Rs RequestSpotInstances Source # 

Request Lenses

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

The required duration for the Spot Instances (also known as Spot blocks), in minutes. This value must be a multiple of 60 (60, 120, 180, 240, 300, or 360). The duration period starts as soon as your Spot Instance receives its instance ID. At the end of the duration period, Amazon EC2 marks the Spot Instance for termination and provides a Spot Instance termination notice, which gives the instance a two-minute warning before it terminates. You can't specify an Availability Zone group or a launch group if you specify a duration.

rClientToken :: 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 .

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

The maximum number of Spot Instances to launch. Default: 1

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

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

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

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

rAvailabilityZoneGroup :: 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.

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

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

rLaunchGroup :: 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

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

The Spot Instance request type. Default: one-time

rValidFrom :: 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.

rDryRun :: 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 .

Destructuring the Response

requestSpotInstancesResponse Source #

Creates a value of RequestSpotInstancesResponse with the minimum fields required to make a request.

Use one of the following lenses to modify other fields as desired:

data RequestSpotInstancesResponse Source #

Contains the output of RequestSpotInstances.

See: requestSpotInstancesResponse smart constructor.

Instances

Eq RequestSpotInstancesResponse Source # 
Data RequestSpotInstancesResponse Source # 

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> RequestSpotInstancesResponse -> c RequestSpotInstancesResponse #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c RequestSpotInstancesResponse #

toConstr :: RequestSpotInstancesResponse -> Constr #

dataTypeOf :: RequestSpotInstancesResponse -> DataType #

dataCast1 :: Typeable (* -> *) t => (forall d. Data d => c (t d)) -> Maybe (c RequestSpotInstancesResponse) #

dataCast2 :: Typeable (* -> * -> *) t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c RequestSpotInstancesResponse) #

gmapT :: (forall b. Data b => b -> b) -> RequestSpotInstancesResponse -> RequestSpotInstancesResponse #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> RequestSpotInstancesResponse -> r #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> RequestSpotInstancesResponse -> r #

gmapQ :: (forall d. Data d => d -> u) -> RequestSpotInstancesResponse -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> RequestSpotInstancesResponse -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> RequestSpotInstancesResponse -> m RequestSpotInstancesResponse #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> RequestSpotInstancesResponse -> m RequestSpotInstancesResponse #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> RequestSpotInstancesResponse -> m RequestSpotInstancesResponse #

Read RequestSpotInstancesResponse Source # 
Show RequestSpotInstancesResponse Source # 
Generic RequestSpotInstancesResponse Source # 
NFData RequestSpotInstancesResponse Source # 
type Rep RequestSpotInstancesResponse Source # 
type Rep RequestSpotInstancesResponse = D1 * (MetaData "RequestSpotInstancesResponse" "Network.AWS.EC2.RequestSpotInstances" "amazonka-ec2-1.6.0-Kkew7Kpgof6EYi20Z0WOzs" False) (C1 * (MetaCons "RequestSpotInstancesResponse'" PrefixI True) ((:*:) * (S1 * (MetaSel (Just Symbol "_rsirsSpotInstanceRequests") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 * (Maybe [SpotInstanceRequest]))) (S1 * (MetaSel (Just Symbol "_rsirsResponseStatus") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 * Int))))

Response Lenses