#[non_exhaustive]pub struct SpotFleetRequestConfigDataBuilder { /* private fields */ }
Expand description
A builder for SpotFleetRequestConfigData
.
Implementations§
Source§impl SpotFleetRequestConfigDataBuilder
impl SpotFleetRequestConfigDataBuilder
Sourcepub fn allocation_strategy(self, input: AllocationStrategy) -> Self
pub fn allocation_strategy(self, input: AllocationStrategy) -> Self
The strategy that determines how to allocate the target Spot Instance capacity across the Spot Instance pools specified by the Spot Fleet launch configuration. For more information, see Allocation strategies for Spot Instances in the Amazon EC2 User Guide.
- priceCapacityOptimized (recommended)
-
Spot Fleet identifies the pools with the highest capacity availability for the number of instances that are launching. This means that we will request Spot Instances from the pools that we believe have the lowest chance of interruption in the near term. Spot Fleet then requests Spot Instances from the lowest priced of these pools.
- capacityOptimized
-
Spot Fleet identifies the pools with the highest capacity availability for the number of instances that are launching. This means that we will request Spot Instances from the pools that we believe have the lowest chance of interruption in the near term. To give certain instance types a higher chance of launching first, use
capacityOptimizedPrioritized
. Set a priority for each instance type by using thePriority
parameter forLaunchTemplateOverrides
. You can assign the same priority to differentLaunchTemplateOverrides
. EC2 implements the priorities on a best-effort basis, but optimizes for capacity first.capacityOptimizedPrioritized
is supported only if your Spot Fleet uses a launch template. Note that if theOnDemandAllocationStrategy
is set toprioritized
, the same priority is applied when fulfilling On-Demand capacity. - diversified
-
Spot Fleet requests instances from all of the Spot Instance pools that you specify.
- lowestPrice (not recommended)
-
We don't recommend the
lowestPrice
allocation strategy because it has the highest risk of interruption for your Spot Instances.Spot Fleet requests instances from the lowest priced Spot Instance pool that has available capacity. If the lowest priced pool doesn't have available capacity, the Spot Instances come from the next lowest priced pool that has available capacity. If a pool runs out of capacity before fulfilling your desired capacity, Spot Fleet will continue to fulfill your request by drawing from the next lowest priced pool. To ensure that your desired capacity is met, you might receive Spot Instances from several pools. Because this strategy only considers instance price and not capacity availability, it might lead to high interruption rates.
Default: lowestPrice
Sourcepub fn set_allocation_strategy(self, input: Option<AllocationStrategy>) -> Self
pub fn set_allocation_strategy(self, input: Option<AllocationStrategy>) -> Self
The strategy that determines how to allocate the target Spot Instance capacity across the Spot Instance pools specified by the Spot Fleet launch configuration. For more information, see Allocation strategies for Spot Instances in the Amazon EC2 User Guide.
- priceCapacityOptimized (recommended)
-
Spot Fleet identifies the pools with the highest capacity availability for the number of instances that are launching. This means that we will request Spot Instances from the pools that we believe have the lowest chance of interruption in the near term. Spot Fleet then requests Spot Instances from the lowest priced of these pools.
- capacityOptimized
-
Spot Fleet identifies the pools with the highest capacity availability for the number of instances that are launching. This means that we will request Spot Instances from the pools that we believe have the lowest chance of interruption in the near term. To give certain instance types a higher chance of launching first, use
capacityOptimizedPrioritized
. Set a priority for each instance type by using thePriority
parameter forLaunchTemplateOverrides
. You can assign the same priority to differentLaunchTemplateOverrides
. EC2 implements the priorities on a best-effort basis, but optimizes for capacity first.capacityOptimizedPrioritized
is supported only if your Spot Fleet uses a launch template. Note that if theOnDemandAllocationStrategy
is set toprioritized
, the same priority is applied when fulfilling On-Demand capacity. - diversified
-
Spot Fleet requests instances from all of the Spot Instance pools that you specify.
- lowestPrice (not recommended)
-
We don't recommend the
lowestPrice
allocation strategy because it has the highest risk of interruption for your Spot Instances.Spot Fleet requests instances from the lowest priced Spot Instance pool that has available capacity. If the lowest priced pool doesn't have available capacity, the Spot Instances come from the next lowest priced pool that has available capacity. If a pool runs out of capacity before fulfilling your desired capacity, Spot Fleet will continue to fulfill your request by drawing from the next lowest priced pool. To ensure that your desired capacity is met, you might receive Spot Instances from several pools. Because this strategy only considers instance price and not capacity availability, it might lead to high interruption rates.
Default: lowestPrice
Sourcepub fn get_allocation_strategy(&self) -> &Option<AllocationStrategy>
pub fn get_allocation_strategy(&self) -> &Option<AllocationStrategy>
The strategy that determines how to allocate the target Spot Instance capacity across the Spot Instance pools specified by the Spot Fleet launch configuration. For more information, see Allocation strategies for Spot Instances in the Amazon EC2 User Guide.
- priceCapacityOptimized (recommended)
-
Spot Fleet identifies the pools with the highest capacity availability for the number of instances that are launching. This means that we will request Spot Instances from the pools that we believe have the lowest chance of interruption in the near term. Spot Fleet then requests Spot Instances from the lowest priced of these pools.
- capacityOptimized
-
Spot Fleet identifies the pools with the highest capacity availability for the number of instances that are launching. This means that we will request Spot Instances from the pools that we believe have the lowest chance of interruption in the near term. To give certain instance types a higher chance of launching first, use
capacityOptimizedPrioritized
. Set a priority for each instance type by using thePriority
parameter forLaunchTemplateOverrides
. You can assign the same priority to differentLaunchTemplateOverrides
. EC2 implements the priorities on a best-effort basis, but optimizes for capacity first.capacityOptimizedPrioritized
is supported only if your Spot Fleet uses a launch template. Note that if theOnDemandAllocationStrategy
is set toprioritized
, the same priority is applied when fulfilling On-Demand capacity. - diversified
-
Spot Fleet requests instances from all of the Spot Instance pools that you specify.
- lowestPrice (not recommended)
-
We don't recommend the
lowestPrice
allocation strategy because it has the highest risk of interruption for your Spot Instances.Spot Fleet requests instances from the lowest priced Spot Instance pool that has available capacity. If the lowest priced pool doesn't have available capacity, the Spot Instances come from the next lowest priced pool that has available capacity. If a pool runs out of capacity before fulfilling your desired capacity, Spot Fleet will continue to fulfill your request by drawing from the next lowest priced pool. To ensure that your desired capacity is met, you might receive Spot Instances from several pools. Because this strategy only considers instance price and not capacity availability, it might lead to high interruption rates.
Default: lowestPrice
Sourcepub fn on_demand_allocation_strategy(
self,
input: OnDemandAllocationStrategy,
) -> Self
pub fn on_demand_allocation_strategy( self, input: OnDemandAllocationStrategy, ) -> Self
The order of the launch template overrides to use in fulfilling On-Demand capacity. If you specify lowestPrice
, Spot Fleet uses price to determine the order, launching the lowest price first. If you specify prioritized
, Spot Fleet uses the priority that you assign to each Spot Fleet launch template override, launching the highest priority first. If you do not specify a value, Spot Fleet defaults to lowestPrice
.
Sourcepub fn set_on_demand_allocation_strategy(
self,
input: Option<OnDemandAllocationStrategy>,
) -> Self
pub fn set_on_demand_allocation_strategy( self, input: Option<OnDemandAllocationStrategy>, ) -> Self
The order of the launch template overrides to use in fulfilling On-Demand capacity. If you specify lowestPrice
, Spot Fleet uses price to determine the order, launching the lowest price first. If you specify prioritized
, Spot Fleet uses the priority that you assign to each Spot Fleet launch template override, launching the highest priority first. If you do not specify a value, Spot Fleet defaults to lowestPrice
.
Sourcepub fn get_on_demand_allocation_strategy(
&self,
) -> &Option<OnDemandAllocationStrategy>
pub fn get_on_demand_allocation_strategy( &self, ) -> &Option<OnDemandAllocationStrategy>
The order of the launch template overrides to use in fulfilling On-Demand capacity. If you specify lowestPrice
, Spot Fleet uses price to determine the order, launching the lowest price first. If you specify prioritized
, Spot Fleet uses the priority that you assign to each Spot Fleet launch template override, launching the highest priority first. If you do not specify a value, Spot Fleet defaults to lowestPrice
.
Sourcepub fn spot_maintenance_strategies(
self,
input: SpotMaintenanceStrategies,
) -> Self
pub fn spot_maintenance_strategies( self, input: SpotMaintenanceStrategies, ) -> Self
The strategies for managing your Spot Instances that are at an elevated risk of being interrupted.
Sourcepub fn set_spot_maintenance_strategies(
self,
input: Option<SpotMaintenanceStrategies>,
) -> Self
pub fn set_spot_maintenance_strategies( self, input: Option<SpotMaintenanceStrategies>, ) -> Self
The strategies for managing your Spot Instances that are at an elevated risk of being interrupted.
Sourcepub fn get_spot_maintenance_strategies(
&self,
) -> &Option<SpotMaintenanceStrategies>
pub fn get_spot_maintenance_strategies( &self, ) -> &Option<SpotMaintenanceStrategies>
The strategies for managing your Spot Instances that are at an elevated risk of being interrupted.
Sourcepub fn client_token(self, input: impl Into<String>) -> Self
pub fn client_token(self, input: impl Into<String>) -> Self
A unique, case-sensitive identifier that you provide to ensure the idempotency of your listings. This helps to avoid duplicate listings. For more information, see Ensuring Idempotency.
Sourcepub fn set_client_token(self, input: Option<String>) -> Self
pub fn set_client_token(self, input: Option<String>) -> Self
A unique, case-sensitive identifier that you provide to ensure the idempotency of your listings. This helps to avoid duplicate listings. For more information, see Ensuring Idempotency.
Sourcepub fn get_client_token(&self) -> &Option<String>
pub fn get_client_token(&self) -> &Option<String>
A unique, case-sensitive identifier that you provide to ensure the idempotency of your listings. This helps to avoid duplicate listings. For more information, see Ensuring Idempotency.
Sourcepub fn excess_capacity_termination_policy(
self,
input: ExcessCapacityTerminationPolicy,
) -> Self
pub fn excess_capacity_termination_policy( self, input: ExcessCapacityTerminationPolicy, ) -> Self
Indicates whether running instances should be terminated if you decrease the target capacity of the Spot Fleet request below the current size of the Spot Fleet.
Supported only for fleets of type maintain
.
Sourcepub fn set_excess_capacity_termination_policy(
self,
input: Option<ExcessCapacityTerminationPolicy>,
) -> Self
pub fn set_excess_capacity_termination_policy( self, input: Option<ExcessCapacityTerminationPolicy>, ) -> Self
Indicates whether running instances should be terminated if you decrease the target capacity of the Spot Fleet request below the current size of the Spot Fleet.
Supported only for fleets of type maintain
.
Sourcepub fn get_excess_capacity_termination_policy(
&self,
) -> &Option<ExcessCapacityTerminationPolicy>
pub fn get_excess_capacity_termination_policy( &self, ) -> &Option<ExcessCapacityTerminationPolicy>
Indicates whether running instances should be terminated if you decrease the target capacity of the Spot Fleet request below the current size of the Spot Fleet.
Supported only for fleets of type maintain
.
Sourcepub fn fulfilled_capacity(self, input: f64) -> Self
pub fn fulfilled_capacity(self, input: f64) -> Self
The number of units fulfilled by this request compared to the set target capacity. You cannot set this value.
Sourcepub fn set_fulfilled_capacity(self, input: Option<f64>) -> Self
pub fn set_fulfilled_capacity(self, input: Option<f64>) -> Self
The number of units fulfilled by this request compared to the set target capacity. You cannot set this value.
Sourcepub fn get_fulfilled_capacity(&self) -> &Option<f64>
pub fn get_fulfilled_capacity(&self) -> &Option<f64>
The number of units fulfilled by this request compared to the set target capacity. You cannot set this value.
Sourcepub fn on_demand_fulfilled_capacity(self, input: f64) -> Self
pub fn on_demand_fulfilled_capacity(self, input: f64) -> Self
The number of On-Demand units fulfilled by this request compared to the set target On-Demand capacity.
Sourcepub fn set_on_demand_fulfilled_capacity(self, input: Option<f64>) -> Self
pub fn set_on_demand_fulfilled_capacity(self, input: Option<f64>) -> Self
The number of On-Demand units fulfilled by this request compared to the set target On-Demand capacity.
Sourcepub fn get_on_demand_fulfilled_capacity(&self) -> &Option<f64>
pub fn get_on_demand_fulfilled_capacity(&self) -> &Option<f64>
The number of On-Demand units fulfilled by this request compared to the set target On-Demand capacity.
Sourcepub fn iam_fleet_role(self, input: impl Into<String>) -> Self
pub fn iam_fleet_role(self, input: impl Into<String>) -> Self
The Amazon Resource Name (ARN) of an Identity and Access Management (IAM) role that grants the Spot Fleet the permission to request, launch, terminate, and tag instances on your behalf. For more information, see Spot Fleet prerequisites in the Amazon EC2 User Guide. Spot Fleet can terminate Spot Instances on your behalf when you cancel its Spot Fleet request using CancelSpotFleetRequests or when the Spot Fleet request expires, if you set TerminateInstancesWithExpiration
.
Sourcepub fn set_iam_fleet_role(self, input: Option<String>) -> Self
pub fn set_iam_fleet_role(self, input: Option<String>) -> Self
The Amazon Resource Name (ARN) of an Identity and Access Management (IAM) role that grants the Spot Fleet the permission to request, launch, terminate, and tag instances on your behalf. For more information, see Spot Fleet prerequisites in the Amazon EC2 User Guide. Spot Fleet can terminate Spot Instances on your behalf when you cancel its Spot Fleet request using CancelSpotFleetRequests or when the Spot Fleet request expires, if you set TerminateInstancesWithExpiration
.
Sourcepub fn get_iam_fleet_role(&self) -> &Option<String>
pub fn get_iam_fleet_role(&self) -> &Option<String>
The Amazon Resource Name (ARN) of an Identity and Access Management (IAM) role that grants the Spot Fleet the permission to request, launch, terminate, and tag instances on your behalf. For more information, see Spot Fleet prerequisites in the Amazon EC2 User Guide. Spot Fleet can terminate Spot Instances on your behalf when you cancel its Spot Fleet request using CancelSpotFleetRequests or when the Spot Fleet request expires, if you set TerminateInstancesWithExpiration
.
Sourcepub fn launch_specifications(self, input: SpotFleetLaunchSpecification) -> Self
pub fn launch_specifications(self, input: SpotFleetLaunchSpecification) -> Self
Appends an item to launch_specifications
.
To override the contents of this collection use set_launch_specifications
.
The launch specifications for the Spot Fleet request. If you specify LaunchSpecifications
, you can't specify LaunchTemplateConfigs
. If you include On-Demand capacity in your request, you must use LaunchTemplateConfigs
.
If an AMI specified in a launch specification is deregistered or disabled, no new instances can be launched from the AMI. For fleets of type maintain
, the target capacity will not be maintained.
Sourcepub fn set_launch_specifications(
self,
input: Option<Vec<SpotFleetLaunchSpecification>>,
) -> Self
pub fn set_launch_specifications( self, input: Option<Vec<SpotFleetLaunchSpecification>>, ) -> Self
The launch specifications for the Spot Fleet request. If you specify LaunchSpecifications
, you can't specify LaunchTemplateConfigs
. If you include On-Demand capacity in your request, you must use LaunchTemplateConfigs
.
If an AMI specified in a launch specification is deregistered or disabled, no new instances can be launched from the AMI. For fleets of type maintain
, the target capacity will not be maintained.
Sourcepub fn get_launch_specifications(
&self,
) -> &Option<Vec<SpotFleetLaunchSpecification>>
pub fn get_launch_specifications( &self, ) -> &Option<Vec<SpotFleetLaunchSpecification>>
The launch specifications for the Spot Fleet request. If you specify LaunchSpecifications
, you can't specify LaunchTemplateConfigs
. If you include On-Demand capacity in your request, you must use LaunchTemplateConfigs
.
If an AMI specified in a launch specification is deregistered or disabled, no new instances can be launched from the AMI. For fleets of type maintain
, the target capacity will not be maintained.
Sourcepub fn launch_template_configs(self, input: LaunchTemplateConfig) -> Self
pub fn launch_template_configs(self, input: LaunchTemplateConfig) -> Self
Appends an item to launch_template_configs
.
To override the contents of this collection use set_launch_template_configs
.
The launch template and overrides. If you specify LaunchTemplateConfigs
, you can't specify LaunchSpecifications
. If you include On-Demand capacity in your request, you must use LaunchTemplateConfigs
.
Sourcepub fn set_launch_template_configs(
self,
input: Option<Vec<LaunchTemplateConfig>>,
) -> Self
pub fn set_launch_template_configs( self, input: Option<Vec<LaunchTemplateConfig>>, ) -> Self
The launch template and overrides. If you specify LaunchTemplateConfigs
, you can't specify LaunchSpecifications
. If you include On-Demand capacity in your request, you must use LaunchTemplateConfigs
.
Sourcepub fn get_launch_template_configs(&self) -> &Option<Vec<LaunchTemplateConfig>>
pub fn get_launch_template_configs(&self) -> &Option<Vec<LaunchTemplateConfig>>
The launch template and overrides. If you specify LaunchTemplateConfigs
, you can't specify LaunchSpecifications
. If you include On-Demand capacity in your request, you must use LaunchTemplateConfigs
.
Sourcepub fn spot_price(self, input: impl Into<String>) -> Self
pub fn spot_price(self, input: impl Into<String>) -> Self
The maximum price per unit hour that you are 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 specify a maximum price, your instances will be interrupted more frequently than if you do not specify this parameter.
Sourcepub fn set_spot_price(self, input: Option<String>) -> Self
pub fn set_spot_price(self, input: Option<String>) -> Self
The maximum price per unit hour that you are 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 specify a maximum price, your instances will be interrupted more frequently than if you do not specify this parameter.
Sourcepub fn get_spot_price(&self) -> &Option<String>
pub fn get_spot_price(&self) -> &Option<String>
The maximum price per unit hour that you are 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 specify a maximum price, your instances will be interrupted more frequently than if you do not specify this parameter.
Sourcepub fn target_capacity(self, input: i32) -> Self
pub fn target_capacity(self, input: i32) -> Self
The number of units to request for the Spot Fleet. You can choose to set the target capacity in terms of instances or a performance characteristic that is important to your application workload, such as vCPUs, memory, or I/O. If the request type is maintain
, you can specify a target capacity of 0 and add capacity later.
Sourcepub fn set_target_capacity(self, input: Option<i32>) -> Self
pub fn set_target_capacity(self, input: Option<i32>) -> Self
The number of units to request for the Spot Fleet. You can choose to set the target capacity in terms of instances or a performance characteristic that is important to your application workload, such as vCPUs, memory, or I/O. If the request type is maintain
, you can specify a target capacity of 0 and add capacity later.
Sourcepub fn get_target_capacity(&self) -> &Option<i32>
pub fn get_target_capacity(&self) -> &Option<i32>
The number of units to request for the Spot Fleet. You can choose to set the target capacity in terms of instances or a performance characteristic that is important to your application workload, such as vCPUs, memory, or I/O. If the request type is maintain
, you can specify a target capacity of 0 and add capacity later.
Sourcepub fn on_demand_target_capacity(self, input: i32) -> Self
pub fn on_demand_target_capacity(self, input: i32) -> Self
The number of On-Demand units to request. You can choose to set the target capacity in terms of instances or a performance characteristic that is important to your application workload, such as vCPUs, memory, or I/O. If the request type is maintain
, you can specify a target capacity of 0 and add capacity later.
Sourcepub fn set_on_demand_target_capacity(self, input: Option<i32>) -> Self
pub fn set_on_demand_target_capacity(self, input: Option<i32>) -> Self
The number of On-Demand units to request. You can choose to set the target capacity in terms of instances or a performance characteristic that is important to your application workload, such as vCPUs, memory, or I/O. If the request type is maintain
, you can specify a target capacity of 0 and add capacity later.
Sourcepub fn get_on_demand_target_capacity(&self) -> &Option<i32>
pub fn get_on_demand_target_capacity(&self) -> &Option<i32>
The number of On-Demand units to request. You can choose to set the target capacity in terms of instances or a performance characteristic that is important to your application workload, such as vCPUs, memory, or I/O. If the request type is maintain
, you can specify a target capacity of 0 and add capacity later.
Sourcepub fn on_demand_max_total_price(self, input: impl Into<String>) -> Self
pub fn on_demand_max_total_price(self, input: impl Into<String>) -> Self
The maximum amount per hour for On-Demand Instances that you're willing to pay. You can use the onDemandMaxTotalPrice
parameter, the spotMaxTotalPrice
parameter, or both parameters to ensure that your fleet cost does not exceed your budget. If you set a maximum price per hour for the On-Demand Instances and Spot Instances in your request, Spot Fleet will launch instances until it reaches the maximum amount you're willing to pay. When the maximum amount you're willing to pay is reached, the fleet stops launching instances even if it hasn’t met the target capacity.
If your fleet includes T instances that are configured as unlimited
, and if their average CPU usage exceeds the baseline utilization, you will incur a charge for surplus credits. The onDemandMaxTotalPrice
does not account for surplus credits, and, if you use surplus credits, your final cost might be higher than what you specified for onDemandMaxTotalPrice
. For more information, see Surplus credits can incur charges in the Amazon EC2 User Guide.
Sourcepub fn set_on_demand_max_total_price(self, input: Option<String>) -> Self
pub fn set_on_demand_max_total_price(self, input: Option<String>) -> Self
The maximum amount per hour for On-Demand Instances that you're willing to pay. You can use the onDemandMaxTotalPrice
parameter, the spotMaxTotalPrice
parameter, or both parameters to ensure that your fleet cost does not exceed your budget. If you set a maximum price per hour for the On-Demand Instances and Spot Instances in your request, Spot Fleet will launch instances until it reaches the maximum amount you're willing to pay. When the maximum amount you're willing to pay is reached, the fleet stops launching instances even if it hasn’t met the target capacity.
If your fleet includes T instances that are configured as unlimited
, and if their average CPU usage exceeds the baseline utilization, you will incur a charge for surplus credits. The onDemandMaxTotalPrice
does not account for surplus credits, and, if you use surplus credits, your final cost might be higher than what you specified for onDemandMaxTotalPrice
. For more information, see Surplus credits can incur charges in the Amazon EC2 User Guide.
Sourcepub fn get_on_demand_max_total_price(&self) -> &Option<String>
pub fn get_on_demand_max_total_price(&self) -> &Option<String>
The maximum amount per hour for On-Demand Instances that you're willing to pay. You can use the onDemandMaxTotalPrice
parameter, the spotMaxTotalPrice
parameter, or both parameters to ensure that your fleet cost does not exceed your budget. If you set a maximum price per hour for the On-Demand Instances and Spot Instances in your request, Spot Fleet will launch instances until it reaches the maximum amount you're willing to pay. When the maximum amount you're willing to pay is reached, the fleet stops launching instances even if it hasn’t met the target capacity.
If your fleet includes T instances that are configured as unlimited
, and if their average CPU usage exceeds the baseline utilization, you will incur a charge for surplus credits. The onDemandMaxTotalPrice
does not account for surplus credits, and, if you use surplus credits, your final cost might be higher than what you specified for onDemandMaxTotalPrice
. For more information, see Surplus credits can incur charges in the Amazon EC2 User Guide.
Sourcepub fn spot_max_total_price(self, input: impl Into<String>) -> Self
pub fn spot_max_total_price(self, input: impl Into<String>) -> Self
The maximum amount per hour for Spot Instances that you're willing to pay. You can use the spotMaxTotalPrice
parameter, the onDemandMaxTotalPrice
parameter, or both parameters to ensure that your fleet cost does not exceed your budget. If you set a maximum price per hour for the On-Demand Instances and Spot Instances in your request, Spot Fleet will launch instances until it reaches the maximum amount you're willing to pay. When the maximum amount you're willing to pay is reached, the fleet stops launching instances even if it hasn’t met the target capacity.
If your fleet includes T instances that are configured as unlimited
, and if their average CPU usage exceeds the baseline utilization, you will incur a charge for surplus credits. The spotMaxTotalPrice
does not account for surplus credits, and, if you use surplus credits, your final cost might be higher than what you specified for spotMaxTotalPrice
. For more information, see Surplus credits can incur charges in the Amazon EC2 User Guide.
Sourcepub fn set_spot_max_total_price(self, input: Option<String>) -> Self
pub fn set_spot_max_total_price(self, input: Option<String>) -> Self
The maximum amount per hour for Spot Instances that you're willing to pay. You can use the spotMaxTotalPrice
parameter, the onDemandMaxTotalPrice
parameter, or both parameters to ensure that your fleet cost does not exceed your budget. If you set a maximum price per hour for the On-Demand Instances and Spot Instances in your request, Spot Fleet will launch instances until it reaches the maximum amount you're willing to pay. When the maximum amount you're willing to pay is reached, the fleet stops launching instances even if it hasn’t met the target capacity.
If your fleet includes T instances that are configured as unlimited
, and if their average CPU usage exceeds the baseline utilization, you will incur a charge for surplus credits. The spotMaxTotalPrice
does not account for surplus credits, and, if you use surplus credits, your final cost might be higher than what you specified for spotMaxTotalPrice
. For more information, see Surplus credits can incur charges in the Amazon EC2 User Guide.
Sourcepub fn get_spot_max_total_price(&self) -> &Option<String>
pub fn get_spot_max_total_price(&self) -> &Option<String>
The maximum amount per hour for Spot Instances that you're willing to pay. You can use the spotMaxTotalPrice
parameter, the onDemandMaxTotalPrice
parameter, or both parameters to ensure that your fleet cost does not exceed your budget. If you set a maximum price per hour for the On-Demand Instances and Spot Instances in your request, Spot Fleet will launch instances until it reaches the maximum amount you're willing to pay. When the maximum amount you're willing to pay is reached, the fleet stops launching instances even if it hasn’t met the target capacity.
If your fleet includes T instances that are configured as unlimited
, and if their average CPU usage exceeds the baseline utilization, you will incur a charge for surplus credits. The spotMaxTotalPrice
does not account for surplus credits, and, if you use surplus credits, your final cost might be higher than what you specified for spotMaxTotalPrice
. For more information, see Surplus credits can incur charges in the Amazon EC2 User Guide.
Sourcepub fn terminate_instances_with_expiration(self, input: bool) -> Self
pub fn terminate_instances_with_expiration(self, input: bool) -> Self
Indicates whether running Spot Instances are terminated when the Spot Fleet request expires.
Sourcepub fn set_terminate_instances_with_expiration(
self,
input: Option<bool>,
) -> Self
pub fn set_terminate_instances_with_expiration( self, input: Option<bool>, ) -> Self
Indicates whether running Spot Instances are terminated when the Spot Fleet request expires.
Sourcepub fn get_terminate_instances_with_expiration(&self) -> &Option<bool>
pub fn get_terminate_instances_with_expiration(&self) -> &Option<bool>
Indicates whether running Spot Instances are terminated when the Spot Fleet request expires.
Sourcepub fn type(self, input: FleetType) -> Self
pub fn type(self, input: FleetType) -> Self
The type of request. Indicates whether the Spot Fleet only requests the target capacity or also attempts to maintain it. When this value is request
, the Spot Fleet only places the required requests. It does not attempt to replenish Spot Instances if capacity is diminished, nor does it submit requests in alternative Spot pools if capacity is not available. When this value is maintain
, the Spot Fleet maintains the target capacity. The Spot Fleet places the required requests to meet capacity and automatically replenishes any interrupted instances. Default: maintain
. instant
is listed but is not used by Spot Fleet.
Sourcepub fn set_type(self, input: Option<FleetType>) -> Self
pub fn set_type(self, input: Option<FleetType>) -> Self
The type of request. Indicates whether the Spot Fleet only requests the target capacity or also attempts to maintain it. When this value is request
, the Spot Fleet only places the required requests. It does not attempt to replenish Spot Instances if capacity is diminished, nor does it submit requests in alternative Spot pools if capacity is not available. When this value is maintain
, the Spot Fleet maintains the target capacity. The Spot Fleet places the required requests to meet capacity and automatically replenishes any interrupted instances. Default: maintain
. instant
is listed but is not used by Spot Fleet.
Sourcepub fn get_type(&self) -> &Option<FleetType>
pub fn get_type(&self) -> &Option<FleetType>
The type of request. Indicates whether the Spot Fleet only requests the target capacity or also attempts to maintain it. When this value is request
, the Spot Fleet only places the required requests. It does not attempt to replenish Spot Instances if capacity is diminished, nor does it submit requests in alternative Spot pools if capacity is not available. When this value is maintain
, the Spot Fleet maintains the target capacity. The Spot Fleet places the required requests to meet capacity and automatically replenishes any interrupted instances. Default: maintain
. instant
is listed but is not used by Spot Fleet.
Sourcepub fn valid_from(self, input: DateTime) -> Self
pub fn valid_from(self, input: DateTime) -> Self
The start date and time of the request, in UTC format (YYYY-MM-DDTHH:MM:SSZ). By default, Amazon EC2 starts fulfilling the request immediately.
Sourcepub fn set_valid_from(self, input: Option<DateTime>) -> Self
pub fn set_valid_from(self, input: Option<DateTime>) -> Self
The start date and time of the request, in UTC format (YYYY-MM-DDTHH:MM:SSZ). By default, Amazon EC2 starts fulfilling the request immediately.
Sourcepub fn get_valid_from(&self) -> &Option<DateTime>
pub fn get_valid_from(&self) -> &Option<DateTime>
The start date and time of the request, in UTC format (YYYY-MM-DDTHH:MM:SSZ). By default, Amazon EC2 starts fulfilling the request immediately.
Sourcepub fn valid_until(self, input: DateTime) -> Self
pub fn valid_until(self, input: DateTime) -> Self
The end date and time of the request, in UTC format (YYYY-MM-DDTHH:MM:SSZ). After the end date and time, no new Spot Instance requests are placed or able to fulfill the request. If no value is specified, the Spot Fleet request remains until you cancel it.
Sourcepub fn set_valid_until(self, input: Option<DateTime>) -> Self
pub fn set_valid_until(self, input: Option<DateTime>) -> Self
The end date and time of the request, in UTC format (YYYY-MM-DDTHH:MM:SSZ). After the end date and time, no new Spot Instance requests are placed or able to fulfill the request. If no value is specified, the Spot Fleet request remains until you cancel it.
Sourcepub fn get_valid_until(&self) -> &Option<DateTime>
pub fn get_valid_until(&self) -> &Option<DateTime>
The end date and time of the request, in UTC format (YYYY-MM-DDTHH:MM:SSZ). After the end date and time, no new Spot Instance requests are placed or able to fulfill the request. If no value is specified, the Spot Fleet request remains until you cancel it.
Sourcepub fn replace_unhealthy_instances(self, input: bool) -> Self
pub fn replace_unhealthy_instances(self, input: bool) -> Self
Indicates whether Spot Fleet should replace unhealthy instances.
Sourcepub fn set_replace_unhealthy_instances(self, input: Option<bool>) -> Self
pub fn set_replace_unhealthy_instances(self, input: Option<bool>) -> Self
Indicates whether Spot Fleet should replace unhealthy instances.
Sourcepub fn get_replace_unhealthy_instances(&self) -> &Option<bool>
pub fn get_replace_unhealthy_instances(&self) -> &Option<bool>
Indicates whether Spot Fleet should replace unhealthy instances.
Sourcepub fn instance_interruption_behavior(
self,
input: InstanceInterruptionBehavior,
) -> Self
pub fn instance_interruption_behavior( self, input: InstanceInterruptionBehavior, ) -> Self
The behavior when a Spot Instance is interrupted. The default is terminate
.
Sourcepub fn set_instance_interruption_behavior(
self,
input: Option<InstanceInterruptionBehavior>,
) -> Self
pub fn set_instance_interruption_behavior( self, input: Option<InstanceInterruptionBehavior>, ) -> Self
The behavior when a Spot Instance is interrupted. The default is terminate
.
Sourcepub fn get_instance_interruption_behavior(
&self,
) -> &Option<InstanceInterruptionBehavior>
pub fn get_instance_interruption_behavior( &self, ) -> &Option<InstanceInterruptionBehavior>
The behavior when a Spot Instance is interrupted. The default is terminate
.
Sourcepub fn load_balancers_config(self, input: LoadBalancersConfig) -> Self
pub fn load_balancers_config(self, input: LoadBalancersConfig) -> Self
One or more Classic Load Balancers and target groups to attach to the Spot Fleet request. Spot Fleet registers the running Spot Instances with the specified Classic Load Balancers and target groups.
With Network Load Balancers, Spot Fleet cannot register instances that have the following instance types: C1, CC1, CC2, CG1, CG2, CR1, CS1, G1, G2, HI1, HS1, M1, M2, M3, and T1.
Sourcepub fn set_load_balancers_config(
self,
input: Option<LoadBalancersConfig>,
) -> Self
pub fn set_load_balancers_config( self, input: Option<LoadBalancersConfig>, ) -> Self
One or more Classic Load Balancers and target groups to attach to the Spot Fleet request. Spot Fleet registers the running Spot Instances with the specified Classic Load Balancers and target groups.
With Network Load Balancers, Spot Fleet cannot register instances that have the following instance types: C1, CC1, CC2, CG1, CG2, CR1, CS1, G1, G2, HI1, HS1, M1, M2, M3, and T1.
Sourcepub fn get_load_balancers_config(&self) -> &Option<LoadBalancersConfig>
pub fn get_load_balancers_config(&self) -> &Option<LoadBalancersConfig>
One or more Classic Load Balancers and target groups to attach to the Spot Fleet request. Spot Fleet registers the running Spot Instances with the specified Classic Load Balancers and target groups.
With Network Load Balancers, Spot Fleet cannot register instances that have the following instance types: C1, CC1, CC2, CG1, CG2, CR1, CS1, G1, G2, HI1, HS1, M1, M2, M3, and T1.
Sourcepub fn instance_pools_to_use_count(self, input: i32) -> Self
pub fn instance_pools_to_use_count(self, input: i32) -> Self
The number of Spot pools across which to allocate your target Spot capacity. Valid only when Spot AllocationStrategy is set to lowest-price
. Spot Fleet selects the cheapest Spot pools and evenly allocates your target Spot capacity across the number of Spot pools that you specify.
Note that Spot 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, Spot 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.
Sourcepub fn set_instance_pools_to_use_count(self, input: Option<i32>) -> Self
pub fn set_instance_pools_to_use_count(self, input: Option<i32>) -> Self
The number of Spot pools across which to allocate your target Spot capacity. Valid only when Spot AllocationStrategy is set to lowest-price
. Spot Fleet selects the cheapest Spot pools and evenly allocates your target Spot capacity across the number of Spot pools that you specify.
Note that Spot 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, Spot 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.
Sourcepub fn get_instance_pools_to_use_count(&self) -> &Option<i32>
pub fn get_instance_pools_to_use_count(&self) -> &Option<i32>
The number of Spot pools across which to allocate your target Spot capacity. Valid only when Spot AllocationStrategy is set to lowest-price
. Spot Fleet selects the cheapest Spot pools and evenly allocates your target Spot capacity across the number of Spot pools that you specify.
Note that Spot 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, Spot 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.
Sourcepub fn set_context(self, input: Option<String>) -> Self
pub fn set_context(self, input: Option<String>) -> Self
Reserved.
Sourcepub fn get_context(&self) -> &Option<String>
pub fn get_context(&self) -> &Option<String>
Reserved.
Sourcepub fn target_capacity_unit_type(self, input: TargetCapacityUnitType) -> Self
pub fn target_capacity_unit_type(self, input: TargetCapacityUnitType) -> Self
The unit for the target capacity. You can specify this parameter only when using attribute-based instance type selection.
Default: units
(the number of instances)
Sourcepub fn set_target_capacity_unit_type(
self,
input: Option<TargetCapacityUnitType>,
) -> Self
pub fn set_target_capacity_unit_type( self, input: Option<TargetCapacityUnitType>, ) -> Self
The unit for the target capacity. You can specify this parameter only when using attribute-based instance type selection.
Default: units
(the number of instances)
Sourcepub fn get_target_capacity_unit_type(&self) -> &Option<TargetCapacityUnitType>
pub fn get_target_capacity_unit_type(&self) -> &Option<TargetCapacityUnitType>
The unit for the target capacity. You can specify this parameter only when using attribute-based instance type selection.
Default: units
(the number of instances)
Sourcepub fn tag_specifications(self, input: TagSpecification) -> Self
pub fn tag_specifications(self, input: TagSpecification) -> Self
Appends an item to tag_specifications
.
To override the contents of this collection use set_tag_specifications
.
The key-value pair for tagging the Spot Fleet request on creation. The value for ResourceType
must be spot-fleet-request
, otherwise the Spot Fleet request fails. To tag instances at launch, specify the tags in the launch template (valid only if you use LaunchTemplateConfigs
) or in the SpotFleetTagSpecification
(valid only if you use LaunchSpecifications
). For information about tagging after launch, see Tag your resources.
Sourcepub fn set_tag_specifications(
self,
input: Option<Vec<TagSpecification>>,
) -> Self
pub fn set_tag_specifications( self, input: Option<Vec<TagSpecification>>, ) -> Self
The key-value pair for tagging the Spot Fleet request on creation. The value for ResourceType
must be spot-fleet-request
, otherwise the Spot Fleet request fails. To tag instances at launch, specify the tags in the launch template (valid only if you use LaunchTemplateConfigs
) or in the SpotFleetTagSpecification
(valid only if you use LaunchSpecifications
). For information about tagging after launch, see Tag your resources.
Sourcepub fn get_tag_specifications(&self) -> &Option<Vec<TagSpecification>>
pub fn get_tag_specifications(&self) -> &Option<Vec<TagSpecification>>
The key-value pair for tagging the Spot Fleet request on creation. The value for ResourceType
must be spot-fleet-request
, otherwise the Spot Fleet request fails. To tag instances at launch, specify the tags in the launch template (valid only if you use LaunchTemplateConfigs
) or in the SpotFleetTagSpecification
(valid only if you use LaunchSpecifications
). For information about tagging after launch, see Tag your resources.
Sourcepub fn build(self) -> SpotFleetRequestConfigData
pub fn build(self) -> SpotFleetRequestConfigData
Consumes the builder and constructs a SpotFleetRequestConfigData
.
Trait Implementations§
Source§impl Clone for SpotFleetRequestConfigDataBuilder
impl Clone for SpotFleetRequestConfigDataBuilder
Source§fn clone(&self) -> SpotFleetRequestConfigDataBuilder
fn clone(&self) -> SpotFleetRequestConfigDataBuilder
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Default for SpotFleetRequestConfigDataBuilder
impl Default for SpotFleetRequestConfigDataBuilder
Source§fn default() -> SpotFleetRequestConfigDataBuilder
fn default() -> SpotFleetRequestConfigDataBuilder
Source§impl PartialEq for SpotFleetRequestConfigDataBuilder
impl PartialEq for SpotFleetRequestConfigDataBuilder
Source§fn eq(&self, other: &SpotFleetRequestConfigDataBuilder) -> bool
fn eq(&self, other: &SpotFleetRequestConfigDataBuilder) -> bool
self
and other
values to be equal, and is used by ==
.impl StructuralPartialEq for SpotFleetRequestConfigDataBuilder
Auto Trait Implementations§
impl Freeze for SpotFleetRequestConfigDataBuilder
impl RefUnwindSafe for SpotFleetRequestConfigDataBuilder
impl Send for SpotFleetRequestConfigDataBuilder
impl Sync for SpotFleetRequestConfigDataBuilder
impl Unpin for SpotFleetRequestConfigDataBuilder
impl UnwindSafe for SpotFleetRequestConfigDataBuilder
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Paint for Twhere
T: ?Sized,
impl<T> Paint for Twhere
T: ?Sized,
Source§fn fg(&self, value: Color) -> Painted<&T>
fn fg(&self, value: Color) -> Painted<&T>
Returns a styled value derived from self
with the foreground set to
value
.
This method should be used rarely. Instead, prefer to use color-specific
builder methods like red()
and
green()
, which have the same functionality but are
pithier.
§Example
Set foreground color to white using fg()
:
use yansi::{Paint, Color};
painted.fg(Color::White);
Set foreground color to white using white()
.
use yansi::Paint;
painted.white();
Source§fn bright_black(&self) -> Painted<&T>
fn bright_black(&self) -> Painted<&T>
Source§fn bright_red(&self) -> Painted<&T>
fn bright_red(&self) -> Painted<&T>
Source§fn bright_green(&self) -> Painted<&T>
fn bright_green(&self) -> Painted<&T>
Source§fn bright_yellow(&self) -> Painted<&T>
fn bright_yellow(&self) -> Painted<&T>
Source§fn bright_blue(&self) -> Painted<&T>
fn bright_blue(&self) -> Painted<&T>
Source§fn bright_magenta(&self) -> Painted<&T>
fn bright_magenta(&self) -> Painted<&T>
Source§fn bright_cyan(&self) -> Painted<&T>
fn bright_cyan(&self) -> Painted<&T>
Source§fn bright_white(&self) -> Painted<&T>
fn bright_white(&self) -> Painted<&T>
Source§fn bg(&self, value: Color) -> Painted<&T>
fn bg(&self, value: Color) -> Painted<&T>
Returns a styled value derived from self
with the background set to
value
.
This method should be used rarely. Instead, prefer to use color-specific
builder methods like on_red()
and
on_green()
, which have the same functionality but
are pithier.
§Example
Set background color to red using fg()
:
use yansi::{Paint, Color};
painted.bg(Color::Red);
Set background color to red using on_red()
.
use yansi::Paint;
painted.on_red();
Source§fn on_primary(&self) -> Painted<&T>
fn on_primary(&self) -> Painted<&T>
Source§fn on_magenta(&self) -> Painted<&T>
fn on_magenta(&self) -> Painted<&T>
Source§fn on_bright_black(&self) -> Painted<&T>
fn on_bright_black(&self) -> Painted<&T>
Source§fn on_bright_red(&self) -> Painted<&T>
fn on_bright_red(&self) -> Painted<&T>
Source§fn on_bright_green(&self) -> Painted<&T>
fn on_bright_green(&self) -> Painted<&T>
Source§fn on_bright_yellow(&self) -> Painted<&T>
fn on_bright_yellow(&self) -> Painted<&T>
Source§fn on_bright_blue(&self) -> Painted<&T>
fn on_bright_blue(&self) -> Painted<&T>
Source§fn on_bright_magenta(&self) -> Painted<&T>
fn on_bright_magenta(&self) -> Painted<&T>
Source§fn on_bright_cyan(&self) -> Painted<&T>
fn on_bright_cyan(&self) -> Painted<&T>
Source§fn on_bright_white(&self) -> Painted<&T>
fn on_bright_white(&self) -> Painted<&T>
Source§fn attr(&self, value: Attribute) -> Painted<&T>
fn attr(&self, value: Attribute) -> Painted<&T>
Enables the styling Attribute
value
.
This method should be used rarely. Instead, prefer to use
attribute-specific builder methods like bold()
and
underline()
, which have the same functionality
but are pithier.
§Example
Make text bold using attr()
:
use yansi::{Paint, Attribute};
painted.attr(Attribute::Bold);
Make text bold using using bold()
.
use yansi::Paint;
painted.bold();
Source§fn rapid_blink(&self) -> Painted<&T>
fn rapid_blink(&self) -> Painted<&T>
Source§fn quirk(&self, value: Quirk) -> Painted<&T>
fn quirk(&self, value: Quirk) -> Painted<&T>
Enables the yansi
Quirk
value
.
This method should be used rarely. Instead, prefer to use quirk-specific
builder methods like mask()
and
wrap()
, which have the same functionality but are
pithier.
§Example
Enable wrapping using .quirk()
:
use yansi::{Paint, Quirk};
painted.quirk(Quirk::Wrap);
Enable wrapping using wrap()
.
use yansi::Paint;
painted.wrap();
Source§fn clear(&self) -> Painted<&T>
👎Deprecated since 1.0.1: renamed to resetting()
due to conflicts with Vec::clear()
.
The clear()
method will be removed in a future release.
fn clear(&self) -> Painted<&T>
resetting()
due to conflicts with Vec::clear()
.
The clear()
method will be removed in a future release.Source§fn whenever(&self, value: Condition) -> Painted<&T>
fn whenever(&self, value: Condition) -> Painted<&T>
Conditionally enable styling based on whether the Condition
value
applies. Replaces any previous condition.
See the crate level docs for more details.
§Example
Enable styling painted
only when both stdout
and stderr
are TTYs:
use yansi::{Paint, Condition};
painted.red().on_yellow().whenever(Condition::STDOUTERR_ARE_TTY);