aws_sdk_emr/types/_spot_resizing_specification.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>The resize specification for Spot Instances in the instance fleet, which contains the resize timeout period.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct SpotResizingSpecification {
7 /// <p>Spot resize timeout in minutes. If Spot Instances are not provisioned within this time, the resize workflow will stop provisioning of Spot instances. Minimum value is 5 minutes and maximum value is 10,080 minutes (7 days). The timeout applies to all resize workflows on the Instance Fleet. The resize could be triggered by Amazon EMR Managed Scaling or by the customer (via Amazon EMR Console, Amazon EMR CLI modify-instance-fleet or Amazon EMR SDK ModifyInstanceFleet API) or by Amazon EMR due to Amazon EC2 Spot Reclamation.</p>
8 pub timeout_duration_minutes: ::std::option::Option<i32>,
9 /// <p>Specifies the allocation strategy to use to launch Spot instances during a resize. If you run Amazon EMR releases 6.9.0 or higher, the default is <code>price-capacity-optimized</code>. If you run Amazon EMR releases 6.8.0 or lower, the default is <code>capacity-optimized</code>.</p>
10 pub allocation_strategy: ::std::option::Option<crate::types::SpotProvisioningAllocationStrategy>,
11}
12impl SpotResizingSpecification {
13 /// <p>Spot resize timeout in minutes. If Spot Instances are not provisioned within this time, the resize workflow will stop provisioning of Spot instances. Minimum value is 5 minutes and maximum value is 10,080 minutes (7 days). The timeout applies to all resize workflows on the Instance Fleet. The resize could be triggered by Amazon EMR Managed Scaling or by the customer (via Amazon EMR Console, Amazon EMR CLI modify-instance-fleet or Amazon EMR SDK ModifyInstanceFleet API) or by Amazon EMR due to Amazon EC2 Spot Reclamation.</p>
14 pub fn timeout_duration_minutes(&self) -> ::std::option::Option<i32> {
15 self.timeout_duration_minutes
16 }
17 /// <p>Specifies the allocation strategy to use to launch Spot instances during a resize. If you run Amazon EMR releases 6.9.0 or higher, the default is <code>price-capacity-optimized</code>. If you run Amazon EMR releases 6.8.0 or lower, the default is <code>capacity-optimized</code>.</p>
18 pub fn allocation_strategy(&self) -> ::std::option::Option<&crate::types::SpotProvisioningAllocationStrategy> {
19 self.allocation_strategy.as_ref()
20 }
21}
22impl SpotResizingSpecification {
23 /// Creates a new builder-style object to manufacture [`SpotResizingSpecification`](crate::types::SpotResizingSpecification).
24 pub fn builder() -> crate::types::builders::SpotResizingSpecificationBuilder {
25 crate::types::builders::SpotResizingSpecificationBuilder::default()
26 }
27}
28
29/// A builder for [`SpotResizingSpecification`](crate::types::SpotResizingSpecification).
30#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
31#[non_exhaustive]
32pub struct SpotResizingSpecificationBuilder {
33 pub(crate) timeout_duration_minutes: ::std::option::Option<i32>,
34 pub(crate) allocation_strategy: ::std::option::Option<crate::types::SpotProvisioningAllocationStrategy>,
35}
36impl SpotResizingSpecificationBuilder {
37 /// <p>Spot resize timeout in minutes. If Spot Instances are not provisioned within this time, the resize workflow will stop provisioning of Spot instances. Minimum value is 5 minutes and maximum value is 10,080 minutes (7 days). The timeout applies to all resize workflows on the Instance Fleet. The resize could be triggered by Amazon EMR Managed Scaling or by the customer (via Amazon EMR Console, Amazon EMR CLI modify-instance-fleet or Amazon EMR SDK ModifyInstanceFleet API) or by Amazon EMR due to Amazon EC2 Spot Reclamation.</p>
38 pub fn timeout_duration_minutes(mut self, input: i32) -> Self {
39 self.timeout_duration_minutes = ::std::option::Option::Some(input);
40 self
41 }
42 /// <p>Spot resize timeout in minutes. If Spot Instances are not provisioned within this time, the resize workflow will stop provisioning of Spot instances. Minimum value is 5 minutes and maximum value is 10,080 minutes (7 days). The timeout applies to all resize workflows on the Instance Fleet. The resize could be triggered by Amazon EMR Managed Scaling or by the customer (via Amazon EMR Console, Amazon EMR CLI modify-instance-fleet or Amazon EMR SDK ModifyInstanceFleet API) or by Amazon EMR due to Amazon EC2 Spot Reclamation.</p>
43 pub fn set_timeout_duration_minutes(mut self, input: ::std::option::Option<i32>) -> Self {
44 self.timeout_duration_minutes = input;
45 self
46 }
47 /// <p>Spot resize timeout in minutes. If Spot Instances are not provisioned within this time, the resize workflow will stop provisioning of Spot instances. Minimum value is 5 minutes and maximum value is 10,080 minutes (7 days). The timeout applies to all resize workflows on the Instance Fleet. The resize could be triggered by Amazon EMR Managed Scaling or by the customer (via Amazon EMR Console, Amazon EMR CLI modify-instance-fleet or Amazon EMR SDK ModifyInstanceFleet API) or by Amazon EMR due to Amazon EC2 Spot Reclamation.</p>
48 pub fn get_timeout_duration_minutes(&self) -> &::std::option::Option<i32> {
49 &self.timeout_duration_minutes
50 }
51 /// <p>Specifies the allocation strategy to use to launch Spot instances during a resize. If you run Amazon EMR releases 6.9.0 or higher, the default is <code>price-capacity-optimized</code>. If you run Amazon EMR releases 6.8.0 or lower, the default is <code>capacity-optimized</code>.</p>
52 pub fn allocation_strategy(mut self, input: crate::types::SpotProvisioningAllocationStrategy) -> Self {
53 self.allocation_strategy = ::std::option::Option::Some(input);
54 self
55 }
56 /// <p>Specifies the allocation strategy to use to launch Spot instances during a resize. If you run Amazon EMR releases 6.9.0 or higher, the default is <code>price-capacity-optimized</code>. If you run Amazon EMR releases 6.8.0 or lower, the default is <code>capacity-optimized</code>.</p>
57 pub fn set_allocation_strategy(mut self, input: ::std::option::Option<crate::types::SpotProvisioningAllocationStrategy>) -> Self {
58 self.allocation_strategy = input;
59 self
60 }
61 /// <p>Specifies the allocation strategy to use to launch Spot instances during a resize. If you run Amazon EMR releases 6.9.0 or higher, the default is <code>price-capacity-optimized</code>. If you run Amazon EMR releases 6.8.0 or lower, the default is <code>capacity-optimized</code>.</p>
62 pub fn get_allocation_strategy(&self) -> &::std::option::Option<crate::types::SpotProvisioningAllocationStrategy> {
63 &self.allocation_strategy
64 }
65 /// Consumes the builder and constructs a [`SpotResizingSpecification`](crate::types::SpotResizingSpecification).
66 pub fn build(self) -> crate::types::SpotResizingSpecification {
67 crate::types::SpotResizingSpecification {
68 timeout_duration_minutes: self.timeout_duration_minutes,
69 allocation_strategy: self.allocation_strategy,
70 }
71 }
72}