Struct aws_sdk_ec2::operation::modify_spot_fleet_request::builders::ModifySpotFleetRequestFluentBuilder
source · pub struct ModifySpotFleetRequestFluentBuilder { /* private fields */ }
Expand description
Fluent builder constructing a request to ModifySpotFleetRequest
.
Modifies the specified Spot Fleet request.
You can only modify a Spot Fleet request of type maintain
.
While the Spot Fleet request is being modified, it is in the modifying
state.
To scale up your Spot Fleet, increase its target capacity. The Spot Fleet launches the additional Spot Instances according to the allocation strategy for the Spot Fleet request. If the allocation strategy is lowestPrice
, the Spot Fleet launches instances using the Spot Instance pool with the lowest price. If the allocation strategy is diversified
, the Spot Fleet distributes the instances across the Spot Instance pools. If the allocation strategy is capacityOptimized
, Spot Fleet launches instances from Spot Instance pools with optimal capacity for the number of instances that are launching.
To scale down your Spot Fleet, decrease its target capacity. First, the Spot Fleet cancels any open requests that exceed the new target capacity. You can request that the Spot Fleet terminate Spot Instances until the size of the fleet no longer exceeds the new target capacity. If the allocation strategy is lowestPrice
, the Spot Fleet terminates the instances with the highest price per unit. If the allocation strategy is capacityOptimized
, the Spot Fleet terminates the instances in the Spot Instance pools that have the least available Spot Instance capacity. If the allocation strategy is diversified
, the Spot Fleet terminates instances across the Spot Instance pools. Alternatively, you can request that the Spot Fleet keep the fleet at its current size, but not replace any Spot Instances that are interrupted or that you terminate manually.
If you are finished with your Spot Fleet for now, but will use it again later, you can set the target capacity to 0.
Implementations§
source§impl ModifySpotFleetRequestFluentBuilder
impl ModifySpotFleetRequestFluentBuilder
sourcepub fn as_input(&self) -> &ModifySpotFleetRequestInputBuilder
pub fn as_input(&self) -> &ModifySpotFleetRequestInputBuilder
Access the ModifySpotFleetRequest as a reference.
sourcepub async fn send(
self
) -> Result<ModifySpotFleetRequestOutput, SdkError<ModifySpotFleetRequestError, HttpResponse>>
pub async fn send( self ) -> Result<ModifySpotFleetRequestOutput, SdkError<ModifySpotFleetRequestError, HttpResponse>>
Sends the request and returns the response.
If an error occurs, an SdkError
will be returned with additional details that
can be matched against.
By default, any retryable failures will be retried twice. Retry behavior is configurable with the RetryConfig, which can be set when configuring the client.
sourcepub fn customize(
self
) -> CustomizableOperation<ModifySpotFleetRequestOutput, ModifySpotFleetRequestError, Self>
pub fn customize( self ) -> CustomizableOperation<ModifySpotFleetRequestOutput, ModifySpotFleetRequestError, Self>
Consumes this builder, creating a customizable operation that can be modified before being sent.
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 the target capacity of the Spot Fleet request is decreased 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 the target capacity of the Spot Fleet request is decreased 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 the target capacity of the Spot Fleet request is decreased below the current size of the Spot Fleet.
Supported only for fleets of type maintain
.
sourcepub fn launch_template_configs(self, input: LaunchTemplateConfig) -> Self
pub fn launch_template_configs(self, input: LaunchTemplateConfig) -> Self
Appends an item to LaunchTemplateConfigs
.
To override the contents of this collection use set_launch_template_configs
.
The launch template and overrides. You can only use this parameter if you specified a launch template (LaunchTemplateConfigs
) in your Spot Fleet request. If you specified LaunchSpecifications
in your Spot Fleet request, then omit this parameter.
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. You can only use this parameter if you specified a launch template (LaunchTemplateConfigs
) in your Spot Fleet request. If you specified LaunchSpecifications
in your Spot Fleet request, then omit this parameter.
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. You can only use this parameter if you specified a launch template (LaunchTemplateConfigs
) in your Spot Fleet request. If you specified LaunchSpecifications
in your Spot Fleet request, then omit this parameter.
sourcepub fn spot_fleet_request_id(self, input: impl Into<String>) -> Self
pub fn spot_fleet_request_id(self, input: impl Into<String>) -> Self
The ID of the Spot Fleet request.
sourcepub fn set_spot_fleet_request_id(self, input: Option<String>) -> Self
pub fn set_spot_fleet_request_id(self, input: Option<String>) -> Self
The ID of the Spot Fleet request.
sourcepub fn get_spot_fleet_request_id(&self) -> &Option<String>
pub fn get_spot_fleet_request_id(&self) -> &Option<String>
The ID of the Spot Fleet request.
sourcepub fn target_capacity(self, input: i32) -> Self
pub fn target_capacity(self, input: i32) -> Self
The size of the fleet.
sourcepub fn set_target_capacity(self, input: Option<i32>) -> Self
pub fn set_target_capacity(self, input: Option<i32>) -> Self
The size of the fleet.
sourcepub fn get_target_capacity(&self) -> &Option<i32>
pub fn get_target_capacity(&self) -> &Option<i32>
The size of the fleet.
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 Instances in the fleet.
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 Instances in the fleet.
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 Instances in the fleet.
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.
Trait Implementations§
source§impl Clone for ModifySpotFleetRequestFluentBuilder
impl Clone for ModifySpotFleetRequestFluentBuilder
source§fn clone(&self) -> ModifySpotFleetRequestFluentBuilder
fn clone(&self) -> ModifySpotFleetRequestFluentBuilder
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more