aws_sdk_ec2/operation/create_fleet/_create_fleet_input.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2#[allow(missing_docs)] // documentation missing in model
3#[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
5pub struct CreateFleetInput {
6 /// <p>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 <code>DryRunOperation</code>. Otherwise, it is <code>UnauthorizedOperation</code>.</p>
7 pub dry_run: ::std::option::Option<bool>,
8 /// <p>Unique, case-sensitive identifier that you provide to ensure the idempotency of the request. If you do not specify a client token, a randomly generated token is used for the request to ensure idempotency.</p>
9 /// <p>For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html">Ensuring idempotency</a>.</p>
10 pub client_token: ::std::option::Option<::std::string::String>,
11 /// <p>Describes the configuration of Spot Instances in an EC2 Fleet.</p>
12 pub spot_options: ::std::option::Option<crate::types::SpotOptionsRequest>,
13 /// <p>Describes the configuration of On-Demand Instances in an EC2 Fleet.</p>
14 pub on_demand_options: ::std::option::Option<crate::types::OnDemandOptionsRequest>,
15 /// <p>Indicates whether running instances should be terminated if the total target capacity of the EC2 Fleet is decreased below the current size of the EC2 Fleet.</p>
16 /// <p>Supported only for fleets of type <code>maintain</code>.</p>
17 pub excess_capacity_termination_policy: ::std::option::Option<crate::types::FleetExcessCapacityTerminationPolicy>,
18 /// <p>The configuration for the EC2 Fleet.</p>
19 pub launch_template_configs: ::std::option::Option<::std::vec::Vec<crate::types::FleetLaunchTemplateConfigRequest>>,
20 /// <p>The number of units to request.</p>
21 pub target_capacity_specification: ::std::option::Option<crate::types::TargetCapacitySpecificationRequest>,
22 /// <p>Indicates whether running instances should be terminated when the EC2 Fleet expires.</p>
23 pub terminate_instances_with_expiration: ::std::option::Option<bool>,
24 /// <p>The fleet type. The default value is <code>maintain</code>.</p>
25 /// <ul>
26 /// <li>
27 /// <p><code>maintain</code> - The EC2 Fleet places an asynchronous request for your desired capacity, and continues to maintain your desired Spot capacity by replenishing interrupted Spot Instances.</p></li>
28 /// <li>
29 /// <p><code>request</code> - The EC2 Fleet places an asynchronous one-time request for your desired capacity, but does submit Spot requests in alternative capacity pools if Spot capacity is unavailable, and does not maintain Spot capacity if Spot Instances are interrupted.</p></li>
30 /// <li>
31 /// <p><code>instant</code> - The EC2 Fleet places a synchronous one-time request for your desired capacity, and returns errors for any instances that could not be launched.</p></li>
32 /// </ul>
33 /// <p>For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-fleet-request-type.html">EC2 Fleet request types</a> in the <i>Amazon EC2 User Guide</i>.</p>
34 pub r#type: ::std::option::Option<crate::types::FleetType>,
35 /// <p>The start date and time of the request, in UTC format (for example, <i>YYYY</i>-<i>MM</i>-<i>DD</i>T<i>HH</i>:<i>MM</i>:<i>SS</i>Z). The default is to start fulfilling the request immediately.</p>
36 pub valid_from: ::std::option::Option<::aws_smithy_types::DateTime>,
37 /// <p>The end date and time of the request, in UTC format (for example, <i>YYYY</i>-<i>MM</i>-<i>DD</i>T<i>HH</i>:<i>MM</i>:<i>SS</i>Z). At this point, no new EC2 Fleet requests are placed or able to fulfill the request. If no value is specified, the request remains until you cancel it.</p>
38 pub valid_until: ::std::option::Option<::aws_smithy_types::DateTime>,
39 /// <p>Indicates whether EC2 Fleet should replace unhealthy Spot Instances. Supported only for fleets of type <code>maintain</code>. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/manage-ec2-fleet.html#ec2-fleet-health-checks">EC2 Fleet health checks</a> in the <i>Amazon EC2 User Guide</i>.</p>
40 pub replace_unhealthy_instances: ::std::option::Option<bool>,
41 /// <p>The key-value pair for tagging the EC2 Fleet request on creation. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Using_Tags.html#tag-resources">Tag your resources</a>.</p>
42 /// <p>If the fleet type is <code>instant</code>, specify a resource type of <code>fleet</code> to tag the fleet or <code>instance</code> to tag the instances at launch.</p>
43 /// <p>If the fleet type is <code>maintain</code> or <code>request</code>, specify a resource type of <code>fleet</code> to tag the fleet. You cannot specify a resource type of <code>instance</code>. To tag instances at launch, specify the tags in a <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-launch-templates.html#create-launch-template">launch template</a>.</p>
44 pub tag_specifications: ::std::option::Option<::std::vec::Vec<crate::types::TagSpecification>>,
45 /// <p>Reserved.</p>
46 pub context: ::std::option::Option<::std::string::String>,
47}
48impl CreateFleetInput {
49 /// <p>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 <code>DryRunOperation</code>. Otherwise, it is <code>UnauthorizedOperation</code>.</p>
50 pub fn dry_run(&self) -> ::std::option::Option<bool> {
51 self.dry_run
52 }
53 /// <p>Unique, case-sensitive identifier that you provide to ensure the idempotency of the request. If you do not specify a client token, a randomly generated token is used for the request to ensure idempotency.</p>
54 /// <p>For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html">Ensuring idempotency</a>.</p>
55 pub fn client_token(&self) -> ::std::option::Option<&str> {
56 self.client_token.as_deref()
57 }
58 /// <p>Describes the configuration of Spot Instances in an EC2 Fleet.</p>
59 pub fn spot_options(&self) -> ::std::option::Option<&crate::types::SpotOptionsRequest> {
60 self.spot_options.as_ref()
61 }
62 /// <p>Describes the configuration of On-Demand Instances in an EC2 Fleet.</p>
63 pub fn on_demand_options(&self) -> ::std::option::Option<&crate::types::OnDemandOptionsRequest> {
64 self.on_demand_options.as_ref()
65 }
66 /// <p>Indicates whether running instances should be terminated if the total target capacity of the EC2 Fleet is decreased below the current size of the EC2 Fleet.</p>
67 /// <p>Supported only for fleets of type <code>maintain</code>.</p>
68 pub fn excess_capacity_termination_policy(&self) -> ::std::option::Option<&crate::types::FleetExcessCapacityTerminationPolicy> {
69 self.excess_capacity_termination_policy.as_ref()
70 }
71 /// <p>The configuration for the EC2 Fleet.</p>
72 ///
73 /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.launch_template_configs.is_none()`.
74 pub fn launch_template_configs(&self) -> &[crate::types::FleetLaunchTemplateConfigRequest] {
75 self.launch_template_configs.as_deref().unwrap_or_default()
76 }
77 /// <p>The number of units to request.</p>
78 pub fn target_capacity_specification(&self) -> ::std::option::Option<&crate::types::TargetCapacitySpecificationRequest> {
79 self.target_capacity_specification.as_ref()
80 }
81 /// <p>Indicates whether running instances should be terminated when the EC2 Fleet expires.</p>
82 pub fn terminate_instances_with_expiration(&self) -> ::std::option::Option<bool> {
83 self.terminate_instances_with_expiration
84 }
85 /// <p>The fleet type. The default value is <code>maintain</code>.</p>
86 /// <ul>
87 /// <li>
88 /// <p><code>maintain</code> - The EC2 Fleet places an asynchronous request for your desired capacity, and continues to maintain your desired Spot capacity by replenishing interrupted Spot Instances.</p></li>
89 /// <li>
90 /// <p><code>request</code> - The EC2 Fleet places an asynchronous one-time request for your desired capacity, but does submit Spot requests in alternative capacity pools if Spot capacity is unavailable, and does not maintain Spot capacity if Spot Instances are interrupted.</p></li>
91 /// <li>
92 /// <p><code>instant</code> - The EC2 Fleet places a synchronous one-time request for your desired capacity, and returns errors for any instances that could not be launched.</p></li>
93 /// </ul>
94 /// <p>For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-fleet-request-type.html">EC2 Fleet request types</a> in the <i>Amazon EC2 User Guide</i>.</p>
95 pub fn r#type(&self) -> ::std::option::Option<&crate::types::FleetType> {
96 self.r#type.as_ref()
97 }
98 /// <p>The start date and time of the request, in UTC format (for example, <i>YYYY</i>-<i>MM</i>-<i>DD</i>T<i>HH</i>:<i>MM</i>:<i>SS</i>Z). The default is to start fulfilling the request immediately.</p>
99 pub fn valid_from(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
100 self.valid_from.as_ref()
101 }
102 /// <p>The end date and time of the request, in UTC format (for example, <i>YYYY</i>-<i>MM</i>-<i>DD</i>T<i>HH</i>:<i>MM</i>:<i>SS</i>Z). At this point, no new EC2 Fleet requests are placed or able to fulfill the request. If no value is specified, the request remains until you cancel it.</p>
103 pub fn valid_until(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
104 self.valid_until.as_ref()
105 }
106 /// <p>Indicates whether EC2 Fleet should replace unhealthy Spot Instances. Supported only for fleets of type <code>maintain</code>. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/manage-ec2-fleet.html#ec2-fleet-health-checks">EC2 Fleet health checks</a> in the <i>Amazon EC2 User Guide</i>.</p>
107 pub fn replace_unhealthy_instances(&self) -> ::std::option::Option<bool> {
108 self.replace_unhealthy_instances
109 }
110 /// <p>The key-value pair for tagging the EC2 Fleet request on creation. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Using_Tags.html#tag-resources">Tag your resources</a>.</p>
111 /// <p>If the fleet type is <code>instant</code>, specify a resource type of <code>fleet</code> to tag the fleet or <code>instance</code> to tag the instances at launch.</p>
112 /// <p>If the fleet type is <code>maintain</code> or <code>request</code>, specify a resource type of <code>fleet</code> to tag the fleet. You cannot specify a resource type of <code>instance</code>. To tag instances at launch, specify the tags in a <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-launch-templates.html#create-launch-template">launch template</a>.</p>
113 ///
114 /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.tag_specifications.is_none()`.
115 pub fn tag_specifications(&self) -> &[crate::types::TagSpecification] {
116 self.tag_specifications.as_deref().unwrap_or_default()
117 }
118 /// <p>Reserved.</p>
119 pub fn context(&self) -> ::std::option::Option<&str> {
120 self.context.as_deref()
121 }
122}
123impl CreateFleetInput {
124 /// Creates a new builder-style object to manufacture [`CreateFleetInput`](crate::operation::create_fleet::CreateFleetInput).
125 pub fn builder() -> crate::operation::create_fleet::builders::CreateFleetInputBuilder {
126 crate::operation::create_fleet::builders::CreateFleetInputBuilder::default()
127 }
128}
129
130/// A builder for [`CreateFleetInput`](crate::operation::create_fleet::CreateFleetInput).
131#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
132#[non_exhaustive]
133pub struct CreateFleetInputBuilder {
134 pub(crate) dry_run: ::std::option::Option<bool>,
135 pub(crate) client_token: ::std::option::Option<::std::string::String>,
136 pub(crate) spot_options: ::std::option::Option<crate::types::SpotOptionsRequest>,
137 pub(crate) on_demand_options: ::std::option::Option<crate::types::OnDemandOptionsRequest>,
138 pub(crate) excess_capacity_termination_policy: ::std::option::Option<crate::types::FleetExcessCapacityTerminationPolicy>,
139 pub(crate) launch_template_configs: ::std::option::Option<::std::vec::Vec<crate::types::FleetLaunchTemplateConfigRequest>>,
140 pub(crate) target_capacity_specification: ::std::option::Option<crate::types::TargetCapacitySpecificationRequest>,
141 pub(crate) terminate_instances_with_expiration: ::std::option::Option<bool>,
142 pub(crate) r#type: ::std::option::Option<crate::types::FleetType>,
143 pub(crate) valid_from: ::std::option::Option<::aws_smithy_types::DateTime>,
144 pub(crate) valid_until: ::std::option::Option<::aws_smithy_types::DateTime>,
145 pub(crate) replace_unhealthy_instances: ::std::option::Option<bool>,
146 pub(crate) tag_specifications: ::std::option::Option<::std::vec::Vec<crate::types::TagSpecification>>,
147 pub(crate) context: ::std::option::Option<::std::string::String>,
148}
149impl CreateFleetInputBuilder {
150 /// <p>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 <code>DryRunOperation</code>. Otherwise, it is <code>UnauthorizedOperation</code>.</p>
151 pub fn dry_run(mut self, input: bool) -> Self {
152 self.dry_run = ::std::option::Option::Some(input);
153 self
154 }
155 /// <p>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 <code>DryRunOperation</code>. Otherwise, it is <code>UnauthorizedOperation</code>.</p>
156 pub fn set_dry_run(mut self, input: ::std::option::Option<bool>) -> Self {
157 self.dry_run = input;
158 self
159 }
160 /// <p>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 <code>DryRunOperation</code>. Otherwise, it is <code>UnauthorizedOperation</code>.</p>
161 pub fn get_dry_run(&self) -> &::std::option::Option<bool> {
162 &self.dry_run
163 }
164 /// <p>Unique, case-sensitive identifier that you provide to ensure the idempotency of the request. If you do not specify a client token, a randomly generated token is used for the request to ensure idempotency.</p>
165 /// <p>For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html">Ensuring idempotency</a>.</p>
166 pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
167 self.client_token = ::std::option::Option::Some(input.into());
168 self
169 }
170 /// <p>Unique, case-sensitive identifier that you provide to ensure the idempotency of the request. If you do not specify a client token, a randomly generated token is used for the request to ensure idempotency.</p>
171 /// <p>For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html">Ensuring idempotency</a>.</p>
172 pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
173 self.client_token = input;
174 self
175 }
176 /// <p>Unique, case-sensitive identifier that you provide to ensure the idempotency of the request. If you do not specify a client token, a randomly generated token is used for the request to ensure idempotency.</p>
177 /// <p>For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html">Ensuring idempotency</a>.</p>
178 pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
179 &self.client_token
180 }
181 /// <p>Describes the configuration of Spot Instances in an EC2 Fleet.</p>
182 pub fn spot_options(mut self, input: crate::types::SpotOptionsRequest) -> Self {
183 self.spot_options = ::std::option::Option::Some(input);
184 self
185 }
186 /// <p>Describes the configuration of Spot Instances in an EC2 Fleet.</p>
187 pub fn set_spot_options(mut self, input: ::std::option::Option<crate::types::SpotOptionsRequest>) -> Self {
188 self.spot_options = input;
189 self
190 }
191 /// <p>Describes the configuration of Spot Instances in an EC2 Fleet.</p>
192 pub fn get_spot_options(&self) -> &::std::option::Option<crate::types::SpotOptionsRequest> {
193 &self.spot_options
194 }
195 /// <p>Describes the configuration of On-Demand Instances in an EC2 Fleet.</p>
196 pub fn on_demand_options(mut self, input: crate::types::OnDemandOptionsRequest) -> Self {
197 self.on_demand_options = ::std::option::Option::Some(input);
198 self
199 }
200 /// <p>Describes the configuration of On-Demand Instances in an EC2 Fleet.</p>
201 pub fn set_on_demand_options(mut self, input: ::std::option::Option<crate::types::OnDemandOptionsRequest>) -> Self {
202 self.on_demand_options = input;
203 self
204 }
205 /// <p>Describes the configuration of On-Demand Instances in an EC2 Fleet.</p>
206 pub fn get_on_demand_options(&self) -> &::std::option::Option<crate::types::OnDemandOptionsRequest> {
207 &self.on_demand_options
208 }
209 /// <p>Indicates whether running instances should be terminated if the total target capacity of the EC2 Fleet is decreased below the current size of the EC2 Fleet.</p>
210 /// <p>Supported only for fleets of type <code>maintain</code>.</p>
211 pub fn excess_capacity_termination_policy(mut self, input: crate::types::FleetExcessCapacityTerminationPolicy) -> Self {
212 self.excess_capacity_termination_policy = ::std::option::Option::Some(input);
213 self
214 }
215 /// <p>Indicates whether running instances should be terminated if the total target capacity of the EC2 Fleet is decreased below the current size of the EC2 Fleet.</p>
216 /// <p>Supported only for fleets of type <code>maintain</code>.</p>
217 pub fn set_excess_capacity_termination_policy(
218 mut self,
219 input: ::std::option::Option<crate::types::FleetExcessCapacityTerminationPolicy>,
220 ) -> Self {
221 self.excess_capacity_termination_policy = input;
222 self
223 }
224 /// <p>Indicates whether running instances should be terminated if the total target capacity of the EC2 Fleet is decreased below the current size of the EC2 Fleet.</p>
225 /// <p>Supported only for fleets of type <code>maintain</code>.</p>
226 pub fn get_excess_capacity_termination_policy(&self) -> &::std::option::Option<crate::types::FleetExcessCapacityTerminationPolicy> {
227 &self.excess_capacity_termination_policy
228 }
229 /// Appends an item to `launch_template_configs`.
230 ///
231 /// To override the contents of this collection use [`set_launch_template_configs`](Self::set_launch_template_configs).
232 ///
233 /// <p>The configuration for the EC2 Fleet.</p>
234 pub fn launch_template_configs(mut self, input: crate::types::FleetLaunchTemplateConfigRequest) -> Self {
235 let mut v = self.launch_template_configs.unwrap_or_default();
236 v.push(input);
237 self.launch_template_configs = ::std::option::Option::Some(v);
238 self
239 }
240 /// <p>The configuration for the EC2 Fleet.</p>
241 pub fn set_launch_template_configs(
242 mut self,
243 input: ::std::option::Option<::std::vec::Vec<crate::types::FleetLaunchTemplateConfigRequest>>,
244 ) -> Self {
245 self.launch_template_configs = input;
246 self
247 }
248 /// <p>The configuration for the EC2 Fleet.</p>
249 pub fn get_launch_template_configs(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::FleetLaunchTemplateConfigRequest>> {
250 &self.launch_template_configs
251 }
252 /// <p>The number of units to request.</p>
253 /// This field is required.
254 pub fn target_capacity_specification(mut self, input: crate::types::TargetCapacitySpecificationRequest) -> Self {
255 self.target_capacity_specification = ::std::option::Option::Some(input);
256 self
257 }
258 /// <p>The number of units to request.</p>
259 pub fn set_target_capacity_specification(mut self, input: ::std::option::Option<crate::types::TargetCapacitySpecificationRequest>) -> Self {
260 self.target_capacity_specification = input;
261 self
262 }
263 /// <p>The number of units to request.</p>
264 pub fn get_target_capacity_specification(&self) -> &::std::option::Option<crate::types::TargetCapacitySpecificationRequest> {
265 &self.target_capacity_specification
266 }
267 /// <p>Indicates whether running instances should be terminated when the EC2 Fleet expires.</p>
268 pub fn terminate_instances_with_expiration(mut self, input: bool) -> Self {
269 self.terminate_instances_with_expiration = ::std::option::Option::Some(input);
270 self
271 }
272 /// <p>Indicates whether running instances should be terminated when the EC2 Fleet expires.</p>
273 pub fn set_terminate_instances_with_expiration(mut self, input: ::std::option::Option<bool>) -> Self {
274 self.terminate_instances_with_expiration = input;
275 self
276 }
277 /// <p>Indicates whether running instances should be terminated when the EC2 Fleet expires.</p>
278 pub fn get_terminate_instances_with_expiration(&self) -> &::std::option::Option<bool> {
279 &self.terminate_instances_with_expiration
280 }
281 /// <p>The fleet type. The default value is <code>maintain</code>.</p>
282 /// <ul>
283 /// <li>
284 /// <p><code>maintain</code> - The EC2 Fleet places an asynchronous request for your desired capacity, and continues to maintain your desired Spot capacity by replenishing interrupted Spot Instances.</p></li>
285 /// <li>
286 /// <p><code>request</code> - The EC2 Fleet places an asynchronous one-time request for your desired capacity, but does submit Spot requests in alternative capacity pools if Spot capacity is unavailable, and does not maintain Spot capacity if Spot Instances are interrupted.</p></li>
287 /// <li>
288 /// <p><code>instant</code> - The EC2 Fleet places a synchronous one-time request for your desired capacity, and returns errors for any instances that could not be launched.</p></li>
289 /// </ul>
290 /// <p>For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-fleet-request-type.html">EC2 Fleet request types</a> in the <i>Amazon EC2 User Guide</i>.</p>
291 pub fn r#type(mut self, input: crate::types::FleetType) -> Self {
292 self.r#type = ::std::option::Option::Some(input);
293 self
294 }
295 /// <p>The fleet type. The default value is <code>maintain</code>.</p>
296 /// <ul>
297 /// <li>
298 /// <p><code>maintain</code> - The EC2 Fleet places an asynchronous request for your desired capacity, and continues to maintain your desired Spot capacity by replenishing interrupted Spot Instances.</p></li>
299 /// <li>
300 /// <p><code>request</code> - The EC2 Fleet places an asynchronous one-time request for your desired capacity, but does submit Spot requests in alternative capacity pools if Spot capacity is unavailable, and does not maintain Spot capacity if Spot Instances are interrupted.</p></li>
301 /// <li>
302 /// <p><code>instant</code> - The EC2 Fleet places a synchronous one-time request for your desired capacity, and returns errors for any instances that could not be launched.</p></li>
303 /// </ul>
304 /// <p>For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-fleet-request-type.html">EC2 Fleet request types</a> in the <i>Amazon EC2 User Guide</i>.</p>
305 pub fn set_type(mut self, input: ::std::option::Option<crate::types::FleetType>) -> Self {
306 self.r#type = input;
307 self
308 }
309 /// <p>The fleet type. The default value is <code>maintain</code>.</p>
310 /// <ul>
311 /// <li>
312 /// <p><code>maintain</code> - The EC2 Fleet places an asynchronous request for your desired capacity, and continues to maintain your desired Spot capacity by replenishing interrupted Spot Instances.</p></li>
313 /// <li>
314 /// <p><code>request</code> - The EC2 Fleet places an asynchronous one-time request for your desired capacity, but does submit Spot requests in alternative capacity pools if Spot capacity is unavailable, and does not maintain Spot capacity if Spot Instances are interrupted.</p></li>
315 /// <li>
316 /// <p><code>instant</code> - The EC2 Fleet places a synchronous one-time request for your desired capacity, and returns errors for any instances that could not be launched.</p></li>
317 /// </ul>
318 /// <p>For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-fleet-request-type.html">EC2 Fleet request types</a> in the <i>Amazon EC2 User Guide</i>.</p>
319 pub fn get_type(&self) -> &::std::option::Option<crate::types::FleetType> {
320 &self.r#type
321 }
322 /// <p>The start date and time of the request, in UTC format (for example, <i>YYYY</i>-<i>MM</i>-<i>DD</i>T<i>HH</i>:<i>MM</i>:<i>SS</i>Z). The default is to start fulfilling the request immediately.</p>
323 pub fn valid_from(mut self, input: ::aws_smithy_types::DateTime) -> Self {
324 self.valid_from = ::std::option::Option::Some(input);
325 self
326 }
327 /// <p>The start date and time of the request, in UTC format (for example, <i>YYYY</i>-<i>MM</i>-<i>DD</i>T<i>HH</i>:<i>MM</i>:<i>SS</i>Z). The default is to start fulfilling the request immediately.</p>
328 pub fn set_valid_from(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
329 self.valid_from = input;
330 self
331 }
332 /// <p>The start date and time of the request, in UTC format (for example, <i>YYYY</i>-<i>MM</i>-<i>DD</i>T<i>HH</i>:<i>MM</i>:<i>SS</i>Z). The default is to start fulfilling the request immediately.</p>
333 pub fn get_valid_from(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
334 &self.valid_from
335 }
336 /// <p>The end date and time of the request, in UTC format (for example, <i>YYYY</i>-<i>MM</i>-<i>DD</i>T<i>HH</i>:<i>MM</i>:<i>SS</i>Z). At this point, no new EC2 Fleet requests are placed or able to fulfill the request. If no value is specified, the request remains until you cancel it.</p>
337 pub fn valid_until(mut self, input: ::aws_smithy_types::DateTime) -> Self {
338 self.valid_until = ::std::option::Option::Some(input);
339 self
340 }
341 /// <p>The end date and time of the request, in UTC format (for example, <i>YYYY</i>-<i>MM</i>-<i>DD</i>T<i>HH</i>:<i>MM</i>:<i>SS</i>Z). At this point, no new EC2 Fleet requests are placed or able to fulfill the request. If no value is specified, the request remains until you cancel it.</p>
342 pub fn set_valid_until(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
343 self.valid_until = input;
344 self
345 }
346 /// <p>The end date and time of the request, in UTC format (for example, <i>YYYY</i>-<i>MM</i>-<i>DD</i>T<i>HH</i>:<i>MM</i>:<i>SS</i>Z). At this point, no new EC2 Fleet requests are placed or able to fulfill the request. If no value is specified, the request remains until you cancel it.</p>
347 pub fn get_valid_until(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
348 &self.valid_until
349 }
350 /// <p>Indicates whether EC2 Fleet should replace unhealthy Spot Instances. Supported only for fleets of type <code>maintain</code>. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/manage-ec2-fleet.html#ec2-fleet-health-checks">EC2 Fleet health checks</a> in the <i>Amazon EC2 User Guide</i>.</p>
351 pub fn replace_unhealthy_instances(mut self, input: bool) -> Self {
352 self.replace_unhealthy_instances = ::std::option::Option::Some(input);
353 self
354 }
355 /// <p>Indicates whether EC2 Fleet should replace unhealthy Spot Instances. Supported only for fleets of type <code>maintain</code>. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/manage-ec2-fleet.html#ec2-fleet-health-checks">EC2 Fleet health checks</a> in the <i>Amazon EC2 User Guide</i>.</p>
356 pub fn set_replace_unhealthy_instances(mut self, input: ::std::option::Option<bool>) -> Self {
357 self.replace_unhealthy_instances = input;
358 self
359 }
360 /// <p>Indicates whether EC2 Fleet should replace unhealthy Spot Instances. Supported only for fleets of type <code>maintain</code>. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/manage-ec2-fleet.html#ec2-fleet-health-checks">EC2 Fleet health checks</a> in the <i>Amazon EC2 User Guide</i>.</p>
361 pub fn get_replace_unhealthy_instances(&self) -> &::std::option::Option<bool> {
362 &self.replace_unhealthy_instances
363 }
364 /// Appends an item to `tag_specifications`.
365 ///
366 /// To override the contents of this collection use [`set_tag_specifications`](Self::set_tag_specifications).
367 ///
368 /// <p>The key-value pair for tagging the EC2 Fleet request on creation. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Using_Tags.html#tag-resources">Tag your resources</a>.</p>
369 /// <p>If the fleet type is <code>instant</code>, specify a resource type of <code>fleet</code> to tag the fleet or <code>instance</code> to tag the instances at launch.</p>
370 /// <p>If the fleet type is <code>maintain</code> or <code>request</code>, specify a resource type of <code>fleet</code> to tag the fleet. You cannot specify a resource type of <code>instance</code>. To tag instances at launch, specify the tags in a <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-launch-templates.html#create-launch-template">launch template</a>.</p>
371 pub fn tag_specifications(mut self, input: crate::types::TagSpecification) -> Self {
372 let mut v = self.tag_specifications.unwrap_or_default();
373 v.push(input);
374 self.tag_specifications = ::std::option::Option::Some(v);
375 self
376 }
377 /// <p>The key-value pair for tagging the EC2 Fleet request on creation. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Using_Tags.html#tag-resources">Tag your resources</a>.</p>
378 /// <p>If the fleet type is <code>instant</code>, specify a resource type of <code>fleet</code> to tag the fleet or <code>instance</code> to tag the instances at launch.</p>
379 /// <p>If the fleet type is <code>maintain</code> or <code>request</code>, specify a resource type of <code>fleet</code> to tag the fleet. You cannot specify a resource type of <code>instance</code>. To tag instances at launch, specify the tags in a <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-launch-templates.html#create-launch-template">launch template</a>.</p>
380 pub fn set_tag_specifications(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::TagSpecification>>) -> Self {
381 self.tag_specifications = input;
382 self
383 }
384 /// <p>The key-value pair for tagging the EC2 Fleet request on creation. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Using_Tags.html#tag-resources">Tag your resources</a>.</p>
385 /// <p>If the fleet type is <code>instant</code>, specify a resource type of <code>fleet</code> to tag the fleet or <code>instance</code> to tag the instances at launch.</p>
386 /// <p>If the fleet type is <code>maintain</code> or <code>request</code>, specify a resource type of <code>fleet</code> to tag the fleet. You cannot specify a resource type of <code>instance</code>. To tag instances at launch, specify the tags in a <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-launch-templates.html#create-launch-template">launch template</a>.</p>
387 pub fn get_tag_specifications(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::TagSpecification>> {
388 &self.tag_specifications
389 }
390 /// <p>Reserved.</p>
391 pub fn context(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
392 self.context = ::std::option::Option::Some(input.into());
393 self
394 }
395 /// <p>Reserved.</p>
396 pub fn set_context(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
397 self.context = input;
398 self
399 }
400 /// <p>Reserved.</p>
401 pub fn get_context(&self) -> &::std::option::Option<::std::string::String> {
402 &self.context
403 }
404 /// Consumes the builder and constructs a [`CreateFleetInput`](crate::operation::create_fleet::CreateFleetInput).
405 pub fn build(self) -> ::std::result::Result<crate::operation::create_fleet::CreateFleetInput, ::aws_smithy_types::error::operation::BuildError> {
406 ::std::result::Result::Ok(crate::operation::create_fleet::CreateFleetInput {
407 dry_run: self.dry_run,
408 client_token: self.client_token,
409 spot_options: self.spot_options,
410 on_demand_options: self.on_demand_options,
411 excess_capacity_termination_policy: self.excess_capacity_termination_policy,
412 launch_template_configs: self.launch_template_configs,
413 target_capacity_specification: self.target_capacity_specification,
414 terminate_instances_with_expiration: self.terminate_instances_with_expiration,
415 r#type: self.r#type,
416 valid_from: self.valid_from,
417 valid_until: self.valid_until,
418 replace_unhealthy_instances: self.replace_unhealthy_instances,
419 tag_specifications: self.tag_specifications,
420 context: self.context,
421 })
422 }
423}