Class: AWSCDK::EC2::CfnLaunchTemplate::SpotOptionsProperty
- Inherits:
-
Jsii::Struct
- Object
- Jsii::Struct
- AWSCDK::EC2::CfnLaunchTemplate::SpotOptionsProperty
- Defined in:
- ec2/cfn_launch_template.rb
Overview
Specifies options for Spot Instances.
SpotOptions is a property of AWS::EC2::LaunchTemplate InstanceMarketOptions .
Instance Attribute Summary collapse
-
#block_duration_minutes ⇒ Numeric?
readonly
Deprecated.
-
#instance_interruption_behavior ⇒ String?
readonly
The behavior when a Spot Instance is interrupted.
-
#max_price ⇒ String?
readonly
The maximum hourly price you're willing to pay for a Spot Instance.
-
#spot_instance_type ⇒ String?
readonly
The Spot Instance request type.
-
#valid_until ⇒ String?
readonly
The end date of the request, in UTC format ( YYYY-MM-DD T HH:MM:SS Z).
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(block_duration_minutes: nil, instance_interruption_behavior: nil, max_price: nil, spot_instance_type: nil, valid_until: nil) ⇒ SpotOptionsProperty
constructor
A new instance of SpotOptionsProperty.
- #to_jsii ⇒ Object
Constructor Details
#initialize(block_duration_minutes: nil, instance_interruption_behavior: nil, max_price: nil, spot_instance_type: nil, valid_until: nil) ⇒ SpotOptionsProperty
Returns a new instance of SpotOptionsProperty.
3636 3637 3638 3639 3640 3641 3642 3643 3644 3645 3646 3647 |
# File 'ec2/cfn_launch_template.rb', line 3636 def initialize(block_duration_minutes: nil, instance_interruption_behavior: nil, max_price: nil, spot_instance_type: nil, valid_until: nil) @block_duration_minutes = block_duration_minutes Jsii::Type.check_type(@block_duration_minutes, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "blockDurationMinutes") unless @block_duration_minutes.nil? @instance_interruption_behavior = instance_interruption_behavior Jsii::Type.check_type(@instance_interruption_behavior, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "instanceInterruptionBehavior") unless @instance_interruption_behavior.nil? @max_price = max_price Jsii::Type.check_type(@max_price, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "maxPrice") unless @max_price.nil? @spot_instance_type = spot_instance_type Jsii::Type.check_type(@spot_instance_type, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "spotInstanceType") unless @spot_instance_type.nil? @valid_until = valid_until Jsii::Type.check_type(@valid_until, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "validUntil") unless @valid_until.nil? end |
Instance Attribute Details
#block_duration_minutes ⇒ Numeric? (readonly)
Deprecated.
3653 3654 3655 |
# File 'ec2/cfn_launch_template.rb', line 3653 def block_duration_minutes @block_duration_minutes end |
#instance_interruption_behavior ⇒ String? (readonly)
The behavior when a Spot Instance is interrupted.
The default is terminate .
3660 3661 3662 |
# File 'ec2/cfn_launch_template.rb', line 3660 def instance_interruption_behavior @instance_interruption_behavior end |
#max_price ⇒ String? (readonly)
The maximum hourly price you're 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 do specify this parameter, it must be more than USD $0.001. Specifying a value below USD $0.001 will result in an InvalidParameterValue error message when the launch template is used to launch an instance.
If you specify a maximum price, your Spot Instances will be interrupted more frequently than if you do not specify this parameter.
3669 3670 3671 |
# File 'ec2/cfn_launch_template.rb', line 3669 def max_price @max_price end |
#spot_instance_type ⇒ String? (readonly)
The Spot Instance request type.
If you are using Spot Instances with an Auto Scaling group, use one-time requests, as the Amazon EC2 Auto Scaling service handles requesting new Spot Instances whenever the group is below its desired capacity.
3676 3677 3678 |
# File 'ec2/cfn_launch_template.rb', line 3676 def spot_instance_type @spot_instance_type end |
#valid_until ⇒ String? (readonly)
The end date of the request, in UTC format ( YYYY-MM-DD T HH:MM:SS Z). Supported only for persistent requests.
- For a persistent request, the request remains active until the
ValidUntildate and time is reached. Otherwise, the request remains active until you cancel it. - For a one-time request,
ValidUntilis not supported. The request remains active until all instances launch or you cancel the request.
Default: 7 days from the current date
3686 3687 3688 |
# File 'ec2/cfn_launch_template.rb', line 3686 def valid_until @valid_until end |
Class Method Details
.jsii_properties ⇒ Object
3688 3689 3690 3691 3692 3693 3694 3695 3696 |
# File 'ec2/cfn_launch_template.rb', line 3688 def self.jsii_properties { :block_duration_minutes => "blockDurationMinutes", :instance_interruption_behavior => "instanceInterruptionBehavior", :max_price => "maxPrice", :spot_instance_type => "spotInstanceType", :valid_until => "validUntil", } end |
Instance Method Details
#to_jsii ⇒ Object
3698 3699 3700 3701 3702 3703 3704 3705 3706 3707 3708 |
# File 'ec2/cfn_launch_template.rb', line 3698 def to_jsii result = {} result.merge!({ "blockDurationMinutes" => @block_duration_minutes, "instanceInterruptionBehavior" => @instance_interruption_behavior, "maxPrice" => @max_price, "spotInstanceType" => @spot_instance_type, "validUntil" => @valid_until, }) result.compact end |