Struct aws_sdk_ec2::client::fluent_builders::ModifySpotFleetRequest
source · [−]pub struct ModifySpotFleetRequest { /* 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
sourceimpl ModifySpotFleetRequest
impl ModifySpotFleetRequest
sourcepub async fn send(
self
) -> Result<ModifySpotFleetRequestOutput, SdkError<ModifySpotFleetRequestError>>
pub async fn send(
self
) -> Result<ModifySpotFleetRequestOutput, SdkError<ModifySpotFleetRequestError>>
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 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 the target capacity of the Spot Fleet request is decreased 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 the target capacity of the Spot Fleet request is decreased below the current size of the Spot Fleet.
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 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 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 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 set_context(self, input: Option<String>) -> Self
pub fn set_context(self, input: Option<String>) -> Self
Reserved.
Trait Implementations
sourceimpl Clone for ModifySpotFleetRequest
impl Clone for ModifySpotFleetRequest
sourcefn clone(&self) -> ModifySpotFleetRequest
fn clone(&self) -> ModifySpotFleetRequest
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
Auto Trait Implementations
impl !RefUnwindSafe for ModifySpotFleetRequest
impl Send for ModifySpotFleetRequest
impl Sync for ModifySpotFleetRequest
impl Unpin for ModifySpotFleetRequest
impl !UnwindSafe for ModifySpotFleetRequest
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> 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