Class: AWSCDK::EC2::CfnSpotFleet::SpotCapacityRebalanceProperty

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
ec2/cfn_spot_fleet.rb

Overview

The Spot Instance replacement strategy to use when Amazon EC2 emits a signal that your Spot Instance is at an elevated risk of being interrupted.

For more information, see Capacity rebalancing in the Amazon EC2 User Guide .

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(replacement_strategy: nil, termination_delay: nil) ⇒ SpotCapacityRebalanceProperty

Returns a new instance of SpotCapacityRebalanceProperty.

Parameters:

  • replacement_strategy (String, nil) (defaults to: nil)

    The replacement strategy to use. Only available for fleets of type maintain .

  • termination_delay (Numeric, nil) (defaults to: nil)

    The amount of time (in seconds) that Amazon EC2 waits before terminating the old Spot Instance after launching a new replacement Spot Instance.



2301
2302
2303
2304
2305
2306
# File 'ec2/cfn_spot_fleet.rb', line 2301

def initialize(replacement_strategy: nil, termination_delay: nil)
  @replacement_strategy = replacement_strategy
  Jsii::Type.check_type(@replacement_strategy, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "replacementStrategy") unless @replacement_strategy.nil?
  @termination_delay = termination_delay
  Jsii::Type.check_type(@termination_delay, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "terminationDelay") unless @termination_delay.nil?
end

Instance Attribute Details

#replacement_strategyString? (readonly)

The replacement strategy to use. Only available for fleets of type maintain .

launch - Spot Fleet launches a new replacement Spot Instance when a rebalance notification is emitted for an existing Spot Instance in the fleet. Spot Fleet does not terminate the instances that receive a rebalance notification. You can terminate the old instances, or you can leave them running. You are charged for all instances while they are running.

launch-before-terminate - Spot Fleet launches a new replacement Spot Instance when a rebalance notification is emitted for an existing Spot Instance in the fleet, and then, after a delay that you specify (in TerminationDelay ), terminates the instances that received a rebalance notification.



2316
2317
2318
# File 'ec2/cfn_spot_fleet.rb', line 2316

def replacement_strategy
  @replacement_strategy
end

#termination_delayNumeric? (readonly)

The amount of time (in seconds) that Amazon EC2 waits before terminating the old Spot Instance after launching a new replacement Spot Instance.

Required when ReplacementStrategy is set to launch-before-terminate .

Not valid when ReplacementStrategy is set to launch .

Valid values: Minimum value of 120 seconds. Maximum value of 7200 seconds.



2327
2328
2329
# File 'ec2/cfn_spot_fleet.rb', line 2327

def termination_delay
  @termination_delay
end

Class Method Details

.jsii_propertiesObject



2329
2330
2331
2332
2333
2334
# File 'ec2/cfn_spot_fleet.rb', line 2329

def self.jsii_properties
  {
    :replacement_strategy => "replacementStrategy",
    :termination_delay => "terminationDelay",
  }
end

Instance Method Details

#to_jsiiObject



2336
2337
2338
2339
2340
2341
2342
2343
# File 'ec2/cfn_spot_fleet.rb', line 2336

def to_jsii
  result = {}
  result.merge!({
    "replacementStrategy" => @replacement_strategy,
    "terminationDelay" => @termination_delay,
  })
  result.compact
end