Class CfnEC2Fleet.SpotOptionsRequestProperty
Specifies the configuration of Spot Instances for an EC2 Fleet.
Implements
Inherited Members
Namespace: Amazon.CDK.AWS.EC2
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public class CfnEC2Fleet.SpotOptionsRequestProperty : CfnEC2Fleet.ISpotOptionsRequestProperty
Syntax (vb)
Public Class CfnEC2Fleet.SpotOptionsRequestProperty Implements CfnEC2Fleet.ISpotOptionsRequestProperty
Remarks
SpotOptionsRequest is a property of the AWS::EC2::EC2Fleet resource.
ExampleMetadata: fixture=_generated
Examples
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.EC2;
var spotOptionsRequestProperty = new SpotOptionsRequestProperty {
AllocationStrategy = "allocationStrategy",
InstanceInterruptionBehavior = "instanceInterruptionBehavior",
InstancePoolsToUseCount = 123,
MaintenanceStrategies = new MaintenanceStrategiesProperty {
CapacityRebalance = new CapacityRebalanceProperty {
ReplacementStrategy = "replacementStrategy",
TerminationDelay = 123
}
},
MaxTotalPrice = "maxTotalPrice",
MinTargetCapacity = 123,
SingleAvailabilityZone = false,
SingleInstanceType = false
};
Synopsis
Constructors
| SpotOptionsRequestProperty() | Specifies the configuration of Spot Instances for an EC2 Fleet. |
Properties
| AllocationStrategy | Indicates how to allocate the target Spot Instance capacity across the Spot Instance pools specified by the EC2 Fleet. |
| InstanceInterruptionBehavior | The behavior when a Spot Instance is interrupted. |
| InstancePoolsToUseCount | The number of Spot pools across which to allocate your target Spot capacity. |
| MaintenanceStrategies | The strategies for managing your Spot Instances that are at an elevated risk of being interrupted. |
| MaxTotalPrice | The maximum amount per hour for Spot Instances that you're willing to pay. |
| MinTargetCapacity | The minimum target capacity for Spot Instances in the fleet. |
| SingleAvailabilityZone | Indicates that the fleet launches all Spot Instances into a single Availability Zone. |
| SingleInstanceType | Indicates that the fleet uses a single instance type to launch all Spot Instances in the fleet. |
Constructors
SpotOptionsRequestProperty()
Specifies the configuration of Spot Instances for an EC2 Fleet.
public SpotOptionsRequestProperty()
Remarks
SpotOptionsRequest is a property of the AWS::EC2::EC2Fleet resource.
ExampleMetadata: fixture=_generated
Examples
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.EC2;
var spotOptionsRequestProperty = new SpotOptionsRequestProperty {
AllocationStrategy = "allocationStrategy",
InstanceInterruptionBehavior = "instanceInterruptionBehavior",
InstancePoolsToUseCount = 123,
MaintenanceStrategies = new MaintenanceStrategiesProperty {
CapacityRebalance = new CapacityRebalanceProperty {
ReplacementStrategy = "replacementStrategy",
TerminationDelay = 123
}
},
MaxTotalPrice = "maxTotalPrice",
MinTargetCapacity = 123,
SingleAvailabilityZone = false,
SingleInstanceType = false
};
Properties
AllocationStrategy
Indicates how to allocate the target Spot Instance capacity across the Spot Instance pools specified by the EC2 Fleet.
public string? AllocationStrategy { get; set; }
Property Value
Remarks
If the allocation strategy is lowestPrice , EC2 Fleet launches instances from the Spot Instance pools with the lowest price. This is the default allocation strategy.
If the allocation strategy is diversified , EC2 Fleet launches instances from all the Spot Instance pools that you specify.
If the allocation strategy is capacityOptimized , EC2 Fleet launches instances from Spot Instance pools that are optimally chosen based on the available Spot Instance capacity.
Allowed Values : lowestPrice | diversified | capacityOptimized | capacityOptimizedPrioritized
InstanceInterruptionBehavior
The behavior when a Spot Instance is interrupted.
public string? InstanceInterruptionBehavior { get; set; }
Property Value
Remarks
InstancePoolsToUseCount
The number of Spot pools across which to allocate your target Spot capacity.
public double? InstancePoolsToUseCount { get; set; }
Property Value
Remarks
Supported only when Spot AllocationStrategy is set to lowest-price . EC2 Fleet selects the cheapest Spot pools and evenly allocates your target Spot capacity across the number of Spot pools that you specify.
Note that EC2 Fleet attempts to draw Spot Instances from the number of pools that you specify on a best effort basis. If a pool runs out of Spot capacity before fulfilling your target capacity, EC2 Fleet will continue to fulfill your request by drawing from the next cheapest pool. To ensure that your target capacity is met, you might receive Spot Instances from more than the number of pools that you specified. Similarly, if most of the pools have no Spot capacity, you might receive your full target capacity from fewer than the number of pools that you specified.
MaintenanceStrategies
The strategies for managing your Spot Instances that are at an elevated risk of being interrupted.
public object? MaintenanceStrategies { get; set; }
Property Value
Remarks
MaxTotalPrice
The maximum amount per hour for Spot Instances that you're willing to pay.
public string? MaxTotalPrice { get; set; }
Property Value
Remarks
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 Spot Instances will be interrupted more frequently than if you do not specify this parameter. > If your fleet includes T instances that are configured as <code>unlimited</code> , and if their average CPU usage exceeds the baseline utilization, you will incur a charge for surplus credits. The <code>MaxTotalPrice</code> does not account for surplus credits, and, if you use surplus credits, your final cost might be higher than what you specified for <code>MaxTotalPrice</code> . For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/burstable-performance-instances-unlimited-mode-concepts.html#unlimited-mode-surplus-credits">Surplus credits can incur charges</a> in the <em>Amazon EC2 User Guide</em> .
MinTargetCapacity
The minimum target capacity for Spot Instances in the fleet.
public double? MinTargetCapacity { get; set; }
Property Value
Remarks
If this minimum capacity isn't reached, no instances are launched.
Constraints: Maximum value of 1000 . Supported only for fleets of type instant .
At least one of the following must be specified: SingleAvailabilityZone | SingleInstanceType
SingleAvailabilityZone
Indicates that the fleet launches all Spot Instances into a single Availability Zone.
public object? SingleAvailabilityZone { get; set; }
Property Value
Remarks
Supported only for fleets of type instant .
Type union: either bool or IResolvable
SingleInstanceType
Indicates that the fleet uses a single instance type to launch all Spot Instances in the fleet.
public object? SingleInstanceType { get; set; }
Property Value
Remarks
Supported only for fleets of type instant .
Type union: either bool or IResolvable