Struct aws_sdk_ec2::input::request_spot_instances_input::Builder
source · [−]pub struct Builder { /* private fields */ }
Expand description
A builder for RequestSpotInstancesInput
.
Implementations
sourceimpl Builder
impl Builder
sourcepub fn availability_zone_group(self, input: impl Into<String>) -> Self
pub fn availability_zone_group(self, input: impl Into<String>) -> Self
The user-specified name for a logical grouping of requests.
When you specify an Availability Zone group in a Spot Instance request, all Spot Instances in the request are launched in the same Availability Zone. Instance proximity is maintained with this parameter, but the choice of Availability Zone is not. The group applies only to requests for Spot Instances of the same instance type. Any additional Spot Instance requests that are specified with the same Availability Zone group name are launched in that same Availability Zone, as long as at least one instance from the group is still active.
If there is no active instance running in the Availability Zone group that you specify for a new Spot Instance request (all instances are terminated, the request is expired, or the maximum price you specified falls below current Spot price), then Amazon EC2 launches the instance in any Availability Zone where the constraint can be met. Consequently, the subsequent set of Spot Instances could be placed in a different zone from the original request, even if you specified the same Availability Zone group.
Default: Instances are launched in any available Availability Zone.
sourcepub fn set_availability_zone_group(self, input: Option<String>) -> Self
pub fn set_availability_zone_group(self, input: Option<String>) -> Self
The user-specified name for a logical grouping of requests.
When you specify an Availability Zone group in a Spot Instance request, all Spot Instances in the request are launched in the same Availability Zone. Instance proximity is maintained with this parameter, but the choice of Availability Zone is not. The group applies only to requests for Spot Instances of the same instance type. Any additional Spot Instance requests that are specified with the same Availability Zone group name are launched in that same Availability Zone, as long as at least one instance from the group is still active.
If there is no active instance running in the Availability Zone group that you specify for a new Spot Instance request (all instances are terminated, the request is expired, or the maximum price you specified falls below current Spot price), then Amazon EC2 launches the instance in any Availability Zone where the constraint can be met. Consequently, the subsequent set of Spot Instances could be placed in a different zone from the original request, even if you specified the same Availability Zone group.
Default: Instances are launched in any available Availability Zone.
sourcepub fn block_duration_minutes(self, input: i32) -> Self
pub fn block_duration_minutes(self, input: i32) -> Self
Deprecated.
sourcepub fn set_block_duration_minutes(self, input: Option<i32>) -> Self
pub fn set_block_duration_minutes(self, input: Option<i32>) -> Self
Deprecated.
sourcepub fn client_token(self, input: impl Into<String>) -> Self
pub fn client_token(self, input: impl Into<String>) -> Self
Unique, case-sensitive identifier that you provide to ensure the idempotency of the request. For more information, see How to Ensure Idempotency in the Amazon EC2 User Guide for Linux Instances.
sourcepub fn set_client_token(self, input: Option<String>) -> Self
pub fn set_client_token(self, input: Option<String>) -> Self
Unique, case-sensitive identifier that you provide to ensure the idempotency of the request. For more information, see How to Ensure Idempotency in the Amazon EC2 User Guide for Linux Instances.
sourcepub fn dry_run(self, input: bool) -> Self
pub fn dry_run(self, input: bool) -> Self
Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation
. Otherwise, it is UnauthorizedOperation
.
sourcepub fn set_dry_run(self, input: Option<bool>) -> Self
pub fn set_dry_run(self, input: Option<bool>) -> Self
Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation
. Otherwise, it is UnauthorizedOperation
.
sourcepub fn instance_count(self, input: i32) -> Self
pub fn instance_count(self, input: i32) -> Self
The maximum number of Spot Instances to launch.
Default: 1
sourcepub fn set_instance_count(self, input: Option<i32>) -> Self
pub fn set_instance_count(self, input: Option<i32>) -> Self
The maximum number of Spot Instances to launch.
Default: 1
sourcepub fn launch_group(self, input: impl Into<String>) -> Self
pub fn launch_group(self, input: impl Into<String>) -> Self
The instance launch group. Launch groups are Spot Instances that launch together and terminate together.
Default: Instances are launched and terminated individually
sourcepub fn set_launch_group(self, input: Option<String>) -> Self
pub fn set_launch_group(self, input: Option<String>) -> Self
The instance launch group. Launch groups are Spot Instances that launch together and terminate together.
Default: Instances are launched and terminated individually
sourcepub fn launch_specification(self, input: RequestSpotLaunchSpecification) -> Self
pub fn launch_specification(self, input: RequestSpotLaunchSpecification) -> Self
The launch specification.
sourcepub fn set_launch_specification(
self,
input: Option<RequestSpotLaunchSpecification>
) -> Self
pub fn set_launch_specification(
self,
input: Option<RequestSpotLaunchSpecification>
) -> Self
The launch specification.
sourcepub fn spot_price(self, input: impl Into<String>) -> Self
pub fn spot_price(self, input: impl Into<String>) -> Self
The maximum price per 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 hour that you are willing to pay for a Spot Instance. The default is the On-Demand price.
sourcepub fn type(self, input: SpotInstanceType) -> Self
pub fn type(self, input: SpotInstanceType) -> Self
The Spot Instance request type.
Default: one-time
sourcepub fn set_type(self, input: Option<SpotInstanceType>) -> Self
pub fn set_type(self, input: Option<SpotInstanceType>) -> Self
The Spot Instance request type.
Default: one-time
sourcepub fn valid_from(self, input: DateTime) -> Self
pub fn valid_from(self, input: DateTime) -> Self
The start date of the request. If this is a one-time request, the request becomes active at this date and time and remains active until all instances launch, the request expires, or the request is canceled. If the request is persistent, the request becomes active at this date and time and remains active until it expires or is canceled.
The specified start date and time cannot be equal to the current date and time. You must specify a start date and time that occurs after the current date and time.
sourcepub fn set_valid_from(self, input: Option<DateTime>) -> Self
pub fn set_valid_from(self, input: Option<DateTime>) -> Self
The start date of the request. If this is a one-time request, the request becomes active at this date and time and remains active until all instances launch, the request expires, or the request is canceled. If the request is persistent, the request becomes active at this date and time and remains active until it expires or is canceled.
The specified start date and time cannot be equal to the current date and time. You must specify a start date and time that occurs after the current date and time.
sourcepub fn valid_until(self, input: DateTime) -> Self
pub fn valid_until(self, input: DateTime) -> Self
The end date of the request, in UTC format (YYYY-MM-DDTHH:MM:SSZ).
-
For a persistent request, the request remains active until the
ValidUntil
date and time is reached. Otherwise, the request remains active until you cancel it. -
For a one-time request, the request remains active until all instances launch, the request is canceled, or the
ValidUntil
date and time is reached. By default, the request is valid for 7 days from the date the request was created.
sourcepub fn set_valid_until(self, input: Option<DateTime>) -> Self
pub fn set_valid_until(self, input: Option<DateTime>) -> Self
The end date of the request, in UTC format (YYYY-MM-DDTHH:MM:SSZ).
-
For a persistent request, the request remains active until the
ValidUntil
date and time is reached. Otherwise, the request remains active until you cancel it. -
For a one-time request, the request remains active until all instances launch, the request is canceled, or the
ValidUntil
date and time is reached. By default, the request is valid for 7 days from the date the request was created.
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 Instance request on creation. The value for ResourceType
must be spot-instances-request
, otherwise the Spot Instance request fails. To tag the Spot Instance request after it has been created, see CreateTags.
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 Instance request on creation. The value for ResourceType
must be spot-instances-request
, otherwise the Spot Instance request fails. To tag the Spot Instance request after it has been created, see CreateTags.
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 build(self) -> Result<RequestSpotInstancesInput, BuildError>
pub fn build(self) -> Result<RequestSpotInstancesInput, BuildError>
Consumes the builder and constructs a RequestSpotInstancesInput
.
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> 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