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

Copyright(c) 2013-2017 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 bid price that you specify exceeds the current Spot price. Amazon EC2 periodically sets the Spot price based on available Spot Instance capacity and current Spot instance requests. For more information, see Spot Instance Requests in the Amazon Elastic Compute Cloud User Guide .

Synopsis

Creating a Request

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:

  • rsisBlockDurationMinutes - 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. Note that you can't specify an Availability Zone group or a launch group if you specify a duration.
  • rsisClientToken - Unique, case-sensitive identifier that you provide to ensure the idempotency of the request. For more information, see How to Ensure Idempotency in the Amazon Elastic Compute Cloud User Guide .
  • rsisInstanceCount - The maximum number of Spot instances to launch. Default: 1
  • rsisInstanceInterruptionBehavior - Indicates whether a Spot instance stops or terminates when it is interrupted.
  • rsisLaunchSpecification - The launch specification.
  • rsisAvailabilityZoneGroup - The user-specified name for a logical grouping of bids. When you specify an Availability Zone group in a Spot Instance request, all Spot instances in the request are launched in the same Availability Zone. Instance proximity is maintained with this parameter, but the choice of Availability Zone is not. The group applies only to bids for Spot Instances of the same instance type. Any additional Spot instance requests that are specified with the same Availability Zone group name are launched in that same Availability Zone, as long as at least one instance from the group is still active. If there is no active instance running in the Availability Zone group that you specify for a new Spot instance request (all instances are terminated, the bid is expired, or the bid falls below current market), then Amazon EC2 launches the instance in any Availability Zone where the constraint can be met. Consequently, the subsequent set of Spot instances could be placed in a different zone from the original request, even if you specified the same Availability Zone group. Default: Instances are launched in any available Availability Zone.
  • rsisValidUntil - The end date of the request. If this is a one-time request, the request remains active until all instances launch, the request is canceled, or this date is reached. If the request is persistent, it remains active until it is canceled or this date and time is reached. Default: The request is effective indefinitely.
  • rsisLaunchGroup - The instance launch group. Launch groups are Spot instances that launch together and terminate together. Default: Instances are launched and terminated individually
  • rsisType - The Spot instance request type. Default: one-time
  • rsisValidFrom - The start date of the request. If this is a one-time request, the request becomes active at this date and time and remains active until all instances launch, the request expires, or the request is canceled. If the request is persistent, the request becomes active at this date and time and remains active until it expires or is canceled. Default: The request is effective indefinitely.
  • rsisDryRun - 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 .
  • rsisSpotPrice - The maximum hourly price (bid) for any Spot instance launched to fulfill the request.

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 # 
ToQuery RequestSpotInstances Source # 
ToPath RequestSpotInstances Source # 
ToHeaders RequestSpotInstances Source # 
type Rep RequestSpotInstances Source # 
type Rep RequestSpotInstances = D1 (MetaData "RequestSpotInstances" "Network.AWS.EC2.RequestSpotInstances" "amazonka-ec2-1.5.0-8IdXK3SzsETDMW2aFpANS9" False) (C1 (MetaCons "RequestSpotInstances'" PrefixI True) ((:*:) ((:*:) ((:*:) (S1 (MetaSel (Just Symbol "_rsisBlockDurationMinutes") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (Maybe Int))) ((:*:) (S1 (MetaSel (Just Symbol "_rsisClientToken") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (Maybe Text))) (S1 (MetaSel (Just Symbol "_rsisInstanceCount") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (Maybe Int))))) ((:*:) (S1 (MetaSel (Just Symbol "_rsisInstanceInterruptionBehavior") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (Maybe InstanceInterruptionBehavior))) ((:*:) (S1 (MetaSel (Just Symbol "_rsisLaunchSpecification") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (Maybe RequestSpotLaunchSpecification))) (S1 (MetaSel (Just Symbol "_rsisAvailabilityZoneGroup") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (Maybe Text)))))) ((:*:) ((:*:) (S1 (MetaSel (Just Symbol "_rsisValidUntil") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (Maybe ISO8601))) ((:*:) (S1 (MetaSel (Just Symbol "_rsisLaunchGroup") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (Maybe Text))) (S1 (MetaSel (Just Symbol "_rsisType") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (Maybe SpotInstanceType))))) ((:*:) (S1 (MetaSel (Just Symbol "_rsisValidFrom") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (Maybe ISO8601))) ((:*:) (S1 (MetaSel (Just Symbol "_rsisDryRun") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (Maybe Bool))) (S1 (MetaSel (Just Symbol "_rsisSpotPrice") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 Text)))))))
type Rs RequestSpotInstances Source # 

Request Lenses

rsisBlockDurationMinutes :: 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. Note that you can't specify an Availability Zone group or a launch group if you specify a duration.

rsisClientToken :: 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 Elastic Compute Cloud User Guide .

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

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

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

Indicates whether a Spot instance stops or terminates when it is interrupted.

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

The user-specified name for a logical grouping of bids. When you specify an Availability Zone group in a Spot Instance request, all Spot instances in the request are launched in the same Availability Zone. Instance proximity is maintained with this parameter, but the choice of Availability Zone is not. The group applies only to bids for Spot Instances of the same instance type. Any additional Spot instance requests that are specified with the same Availability Zone group name are launched in that same Availability Zone, as long as at least one instance from the group is still active. If there is no active instance running in the Availability Zone group that you specify for a new Spot instance request (all instances are terminated, the bid is expired, or the bid falls below current market), then Amazon EC2 launches the instance in any Availability Zone where the constraint can be met. Consequently, the subsequent set of Spot instances could be placed in a different zone from the original request, even if you specified the same Availability Zone group. Default: Instances are launched in any available Availability Zone.

rsisValidUntil :: 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 and time is reached. Default: The request is effective indefinitely.

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

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

The Spot instance request type. Default: one-time

rsisValidFrom :: 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. Default: The request is effective indefinitely.

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

rsisSpotPrice :: Lens' RequestSpotInstances Text Source #

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

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.5.0-8IdXK3SzsETDMW2aFpANS9" 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