Struct aws_sdk_ec2::model::spot_fleet_request_config_data::Builder
source · [−]#[non_exhaustive]pub struct Builder { /* private fields */ }Expand description
A builder for SpotFleetRequestConfigData
Implementations
sourceimpl Builder
impl Builder
sourcepub fn allocation_strategy(self, input: AllocationStrategy) -> Self
pub fn allocation_strategy(self, input: AllocationStrategy) -> Self
Indicates how to allocate the target Spot Instance capacity across the Spot Instance pools specified by the Spot Fleet request.
If the allocation strategy is lowestPrice, Spot Fleet launches instances from the Spot Instance pools with the lowest price. This is the default allocation strategy.
If the allocation strategy is diversified, Spot Fleet launches instances from all the Spot Instance pools that you specify.
If the allocation strategy is capacityOptimized (recommended), Spot Fleet launches instances from Spot Instance pools with optimal capacity for the number of instances that are launching. To give certain instance types a higher chance of launching first, use capacityOptimizedPrioritized. Set a priority for each instance type by using the Priority parameter for LaunchTemplateOverrides. You can assign the same priority to different LaunchTemplateOverrides. 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 the OnDemandAllocationStrategy is set to prioritized, the same priority is applied when fulfilling On-Demand capacity.
sourcepub fn set_allocation_strategy(self, input: Option<AllocationStrategy>) -> Self
pub fn set_allocation_strategy(self, input: Option<AllocationStrategy>) -> Self
Indicates how to allocate the target Spot Instance capacity across the Spot Instance pools specified by the Spot Fleet request.
If the allocation strategy is lowestPrice, Spot Fleet launches instances from the Spot Instance pools with the lowest price. This is the default allocation strategy.
If the allocation strategy is diversified, Spot Fleet launches instances from all the Spot Instance pools that you specify.
If the allocation strategy is capacityOptimized (recommended), Spot Fleet launches instances from Spot Instance pools with optimal capacity for the number of instances that are launching. To give certain instance types a higher chance of launching first, use capacityOptimizedPrioritized. Set a priority for each instance type by using the Priority parameter for LaunchTemplateOverrides. You can assign the same priority to different LaunchTemplateOverrides. 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 the OnDemandAllocationStrategy is set to prioritized, the same priority is applied when fulfilling On-Demand capacity.
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 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 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 excess_capacity_termination_policy(
self,
input: ExcessCapacityTerminationPolicy
) -> Self
pub fn excess_capacity_termination_policy(
self,
input: ExcessCapacityTerminationPolicy
) -> Self
Indicates whether running Spot Instances should be terminated if you decrease the target capacity of the Spot Fleet request below the current size of the Spot Fleet.
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 Spot Instances should be terminated if you decrease the target capacity of the Spot Fleet request below the current size of the Spot Fleet.
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 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 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 for Linux Instances. 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 for Linux Instances. 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.
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.
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 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. The default is the On-Demand price.
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. The default is the On-Demand price.
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 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 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.
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.
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 spotdMaxTotalPrice 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.
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 spotdMaxTotalPrice 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.
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 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 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 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 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 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 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 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 set_context(self, input: Option<String>) -> Self
pub fn set_context(self, input: Option<String>) -> Self
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.
Default: units (translates to 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.
Default: units (translates to 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 Tagging 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 Tagging Your Resources.
sourcepub fn build(self) -> SpotFleetRequestConfigData
pub fn build(self) -> SpotFleetRequestConfigData
Consumes the builder and constructs a SpotFleetRequestConfigData
Trait Implementations
impl StructuralPartialEq for Builder
Auto Trait Implementations
impl RefUnwindSafe for Builder
impl Send for Builder
impl Sync for Builder
impl Unpin for Builder
impl UnwindSafe for Builder
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into)Uses borrowed data to replace owned data, usually by cloning. Read more
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber to this type, returning a
WithDispatch wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber to this type, returning a
WithDispatch wrapper. Read more