aws_sdk_ec2/operation/run_instances/builders.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::run_instances::_run_instances_output::RunInstancesOutputBuilder;
3
4pub use crate::operation::run_instances::_run_instances_input::RunInstancesInputBuilder;
5
6impl crate::operation::run_instances::builders::RunInstancesInputBuilder {
7 /// Sends a request with this input using the given client.
8 pub async fn send_with(
9 self,
10 client: &crate::Client,
11 ) -> ::std::result::Result<
12 crate::operation::run_instances::RunInstancesOutput,
13 ::aws_smithy_runtime_api::client::result::SdkError<
14 crate::operation::run_instances::RunInstancesError,
15 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16 >,
17 > {
18 let mut fluent_builder = client.run_instances();
19 fluent_builder.inner = self;
20 fluent_builder.send().await
21 }
22}
23/// Fluent builder constructing a request to `RunInstances`.
24///
25/// <p>Launches the specified number of instances using an AMI for which you have permissions.</p>
26/// <p>You can specify a number of options, or leave the default options. The following rules apply:</p>
27/// <ul>
28/// <li>
29/// <p>If you don't specify a subnet ID, we choose a default subnet from your default VPC for you. If you don't have a default VPC, you must specify a subnet ID in the request.</p></li>
30/// <li>
31/// <p>All instances have a network interface with a primary private IPv4 address. If you don't specify this address, we choose one from the IPv4 range of your subnet.</p></li>
32/// <li>
33/// <p>Not all instance types support IPv6 addresses. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-types.html">Instance types</a>.</p></li>
34/// <li>
35/// <p>If you don't specify a security group ID, we use the default security group for the VPC. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-network-security.html">Security groups</a>.</p></li>
36/// <li>
37/// <p>If any of the AMIs have a product code attached for which the user has not subscribed, the request fails.</p></li>
38/// </ul>
39/// <p>You can create a <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-launch-templates.html">launch template</a>, which is a resource that contains the parameters to launch an instance. When you launch an instance using <code>RunInstances</code>, you can specify the launch template instead of specifying the launch parameters.</p>
40/// <p>To ensure faster instance launches, break up large requests into smaller batches. For example, create five separate launch requests for 100 instances each instead of one launch request for 500 instances.</p>
41/// <p><code>RunInstances</code> is subject to both request rate limiting and resource rate limiting. For more information, see <a href="https://docs.aws.amazon.com/ec2/latest/devguide/ec2-api-throttling.html">Request throttling</a>.</p>
42/// <p>An instance is ready for you to use when it's in the <code>running</code> state. You can check the state of your instance using <code>DescribeInstances</code>. You can tag instances and EBS volumes during launch, after launch, or both. For more information, see <code>CreateTags</code> and <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Using_Tags.html">Tagging your Amazon EC2 resources</a>.</p>
43/// <p>Linux instances have access to the public key of the key pair at boot. You can use this key to provide secure access to the instance. Amazon EC2 public images use this feature to provide secure access without passwords. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-key-pairs.html">Key pairs</a>.</p>
44/// <p>For troubleshooting, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Using_InstanceStraightToTerminated.html">What to do if an instance immediately terminates</a>, and <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/TroubleshootingInstancesConnecting.html">Troubleshooting connecting to your instance</a>.</p>
45#[derive(::std::clone::Clone, ::std::fmt::Debug)]
46pub struct RunInstancesFluentBuilder {
47 handle: ::std::sync::Arc<crate::client::Handle>,
48 inner: crate::operation::run_instances::builders::RunInstancesInputBuilder,
49 config_override: ::std::option::Option<crate::config::Builder>,
50}
51impl
52 crate::client::customize::internal::CustomizableSend<
53 crate::operation::run_instances::RunInstancesOutput,
54 crate::operation::run_instances::RunInstancesError,
55 > for RunInstancesFluentBuilder
56{
57 fn send(
58 self,
59 config_override: crate::config::Builder,
60 ) -> crate::client::customize::internal::BoxFuture<
61 crate::client::customize::internal::SendResult<
62 crate::operation::run_instances::RunInstancesOutput,
63 crate::operation::run_instances::RunInstancesError,
64 >,
65 > {
66 ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
67 }
68}
69impl RunInstancesFluentBuilder {
70 /// Creates a new `RunInstancesFluentBuilder`.
71 pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
72 Self {
73 handle,
74 inner: ::std::default::Default::default(),
75 config_override: ::std::option::Option::None,
76 }
77 }
78 /// Access the RunInstances as a reference.
79 pub fn as_input(&self) -> &crate::operation::run_instances::builders::RunInstancesInputBuilder {
80 &self.inner
81 }
82 /// Sends the request and returns the response.
83 ///
84 /// If an error occurs, an `SdkError` will be returned with additional details that
85 /// can be matched against.
86 ///
87 /// By default, any retryable failures will be retried twice. Retry behavior
88 /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
89 /// set when configuring the client.
90 pub async fn send(
91 self,
92 ) -> ::std::result::Result<
93 crate::operation::run_instances::RunInstancesOutput,
94 ::aws_smithy_runtime_api::client::result::SdkError<
95 crate::operation::run_instances::RunInstancesError,
96 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
97 >,
98 > {
99 let input = self
100 .inner
101 .build()
102 .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
103 let runtime_plugins = crate::operation::run_instances::RunInstances::operation_runtime_plugins(
104 self.handle.runtime_plugins.clone(),
105 &self.handle.conf,
106 self.config_override,
107 );
108 crate::operation::run_instances::RunInstances::orchestrate(&runtime_plugins, input).await
109 }
110
111 /// Consumes this builder, creating a customizable operation that can be modified before being sent.
112 pub fn customize(
113 self,
114 ) -> crate::client::customize::CustomizableOperation<
115 crate::operation::run_instances::RunInstancesOutput,
116 crate::operation::run_instances::RunInstancesError,
117 Self,
118 > {
119 crate::client::customize::CustomizableOperation::new(self)
120 }
121 pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
122 self.set_config_override(::std::option::Option::Some(config_override.into()));
123 self
124 }
125
126 pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
127 self.config_override = config_override;
128 self
129 }
130 ///
131 /// Appends an item to `BlockDeviceMappings`.
132 ///
133 /// To override the contents of this collection use [`set_block_device_mappings`](Self::set_block_device_mappings).
134 ///
135 /// <p>The block device mapping, which defines the EBS volumes and instance store volumes to attach to the instance at launch. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/block-device-mapping-concepts.html">Block device mappings</a> in the <i>Amazon EC2 User Guide</i>.</p>
136 pub fn block_device_mappings(mut self, input: crate::types::BlockDeviceMapping) -> Self {
137 self.inner = self.inner.block_device_mappings(input);
138 self
139 }
140 /// <p>The block device mapping, which defines the EBS volumes and instance store volumes to attach to the instance at launch. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/block-device-mapping-concepts.html">Block device mappings</a> in the <i>Amazon EC2 User Guide</i>.</p>
141 pub fn set_block_device_mappings(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::BlockDeviceMapping>>) -> Self {
142 self.inner = self.inner.set_block_device_mappings(input);
143 self
144 }
145 /// <p>The block device mapping, which defines the EBS volumes and instance store volumes to attach to the instance at launch. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/block-device-mapping-concepts.html">Block device mappings</a> in the <i>Amazon EC2 User Guide</i>.</p>
146 pub fn get_block_device_mappings(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::BlockDeviceMapping>> {
147 self.inner.get_block_device_mappings()
148 }
149 /// <p>The ID of the AMI. An AMI ID is required to launch an instance and must be specified here or in a launch template.</p>
150 pub fn image_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
151 self.inner = self.inner.image_id(input.into());
152 self
153 }
154 /// <p>The ID of the AMI. An AMI ID is required to launch an instance and must be specified here or in a launch template.</p>
155 pub fn set_image_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
156 self.inner = self.inner.set_image_id(input);
157 self
158 }
159 /// <p>The ID of the AMI. An AMI ID is required to launch an instance and must be specified here or in a launch template.</p>
160 pub fn get_image_id(&self) -> &::std::option::Option<::std::string::String> {
161 self.inner.get_image_id()
162 }
163 /// <p>The instance type. For more information, see <a href="https://docs.aws.amazon.com/ec2/latest/instancetypes/instance-types.html">Amazon EC2 Instance Types Guide</a>.</p>
164 pub fn instance_type(mut self, input: crate::types::InstanceType) -> Self {
165 self.inner = self.inner.instance_type(input);
166 self
167 }
168 /// <p>The instance type. For more information, see <a href="https://docs.aws.amazon.com/ec2/latest/instancetypes/instance-types.html">Amazon EC2 Instance Types Guide</a>.</p>
169 pub fn set_instance_type(mut self, input: ::std::option::Option<crate::types::InstanceType>) -> Self {
170 self.inner = self.inner.set_instance_type(input);
171 self
172 }
173 /// <p>The instance type. For more information, see <a href="https://docs.aws.amazon.com/ec2/latest/instancetypes/instance-types.html">Amazon EC2 Instance Types Guide</a>.</p>
174 pub fn get_instance_type(&self) -> &::std::option::Option<crate::types::InstanceType> {
175 self.inner.get_instance_type()
176 }
177 /// <p>The number of IPv6 addresses to associate with the primary network interface. Amazon EC2 chooses the IPv6 addresses from the range of your subnet. You cannot specify this option and the option to assign specific IPv6 addresses in the same request. You can specify this option if you've specified a minimum number of instances to launch.</p>
178 /// <p>You cannot specify this option and the network interfaces option in the same request.</p>
179 pub fn ipv6_address_count(mut self, input: i32) -> Self {
180 self.inner = self.inner.ipv6_address_count(input);
181 self
182 }
183 /// <p>The number of IPv6 addresses to associate with the primary network interface. Amazon EC2 chooses the IPv6 addresses from the range of your subnet. You cannot specify this option and the option to assign specific IPv6 addresses in the same request. You can specify this option if you've specified a minimum number of instances to launch.</p>
184 /// <p>You cannot specify this option and the network interfaces option in the same request.</p>
185 pub fn set_ipv6_address_count(mut self, input: ::std::option::Option<i32>) -> Self {
186 self.inner = self.inner.set_ipv6_address_count(input);
187 self
188 }
189 /// <p>The number of IPv6 addresses to associate with the primary network interface. Amazon EC2 chooses the IPv6 addresses from the range of your subnet. You cannot specify this option and the option to assign specific IPv6 addresses in the same request. You can specify this option if you've specified a minimum number of instances to launch.</p>
190 /// <p>You cannot specify this option and the network interfaces option in the same request.</p>
191 pub fn get_ipv6_address_count(&self) -> &::std::option::Option<i32> {
192 self.inner.get_ipv6_address_count()
193 }
194 ///
195 /// Appends an item to `Ipv6Addresses`.
196 ///
197 /// To override the contents of this collection use [`set_ipv6_addresses`](Self::set_ipv6_addresses).
198 ///
199 /// <p>The IPv6 addresses from the range of the subnet to associate with the primary network interface. You cannot specify this option and the option to assign a number of IPv6 addresses in the same request. You cannot specify this option if you've specified a minimum number of instances to launch.</p>
200 /// <p>You cannot specify this option and the network interfaces option in the same request.</p>
201 pub fn ipv6_addresses(mut self, input: crate::types::InstanceIpv6Address) -> Self {
202 self.inner = self.inner.ipv6_addresses(input);
203 self
204 }
205 /// <p>The IPv6 addresses from the range of the subnet to associate with the primary network interface. You cannot specify this option and the option to assign a number of IPv6 addresses in the same request. You cannot specify this option if you've specified a minimum number of instances to launch.</p>
206 /// <p>You cannot specify this option and the network interfaces option in the same request.</p>
207 pub fn set_ipv6_addresses(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::InstanceIpv6Address>>) -> Self {
208 self.inner = self.inner.set_ipv6_addresses(input);
209 self
210 }
211 /// <p>The IPv6 addresses from the range of the subnet to associate with the primary network interface. You cannot specify this option and the option to assign a number of IPv6 addresses in the same request. You cannot specify this option if you've specified a minimum number of instances to launch.</p>
212 /// <p>You cannot specify this option and the network interfaces option in the same request.</p>
213 pub fn get_ipv6_addresses(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::InstanceIpv6Address>> {
214 self.inner.get_ipv6_addresses()
215 }
216 /// <p>The ID of the kernel.</p><important>
217 /// <p>We recommend that you use PV-GRUB instead of kernels and RAM disks. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/UserProvidedkernels.html">PV-GRUB</a> in the <i>Amazon EC2 User Guide</i>.</p>
218 /// </important>
219 pub fn kernel_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
220 self.inner = self.inner.kernel_id(input.into());
221 self
222 }
223 /// <p>The ID of the kernel.</p><important>
224 /// <p>We recommend that you use PV-GRUB instead of kernels and RAM disks. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/UserProvidedkernels.html">PV-GRUB</a> in the <i>Amazon EC2 User Guide</i>.</p>
225 /// </important>
226 pub fn set_kernel_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
227 self.inner = self.inner.set_kernel_id(input);
228 self
229 }
230 /// <p>The ID of the kernel.</p><important>
231 /// <p>We recommend that you use PV-GRUB instead of kernels and RAM disks. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/UserProvidedkernels.html">PV-GRUB</a> in the <i>Amazon EC2 User Guide</i>.</p>
232 /// </important>
233 pub fn get_kernel_id(&self) -> &::std::option::Option<::std::string::String> {
234 self.inner.get_kernel_id()
235 }
236 /// <p>The name of the key pair. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/create-key-pairs.html">Create a key pair for your EC2 instance</a>.</p><important>
237 /// <p>If you do not specify a key pair, you can't connect to the instance unless you choose an AMI that is configured to allow users another way to log in.</p>
238 /// </important>
239 pub fn key_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
240 self.inner = self.inner.key_name(input.into());
241 self
242 }
243 /// <p>The name of the key pair. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/create-key-pairs.html">Create a key pair for your EC2 instance</a>.</p><important>
244 /// <p>If you do not specify a key pair, you can't connect to the instance unless you choose an AMI that is configured to allow users another way to log in.</p>
245 /// </important>
246 pub fn set_key_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
247 self.inner = self.inner.set_key_name(input);
248 self
249 }
250 /// <p>The name of the key pair. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/create-key-pairs.html">Create a key pair for your EC2 instance</a>.</p><important>
251 /// <p>If you do not specify a key pair, you can't connect to the instance unless you choose an AMI that is configured to allow users another way to log in.</p>
252 /// </important>
253 pub fn get_key_name(&self) -> &::std::option::Option<::std::string::String> {
254 self.inner.get_key_name()
255 }
256 /// <p>The maximum number of instances to launch. If you specify a value that is more capacity than Amazon EC2 can launch in the target Availability Zone, Amazon EC2 launches the largest possible number of instances above the specified minimum count.</p>
257 /// <p>Constraints: Between 1 and the quota for the specified instance type for your account for this Region. For more information, see <a href="https://docs.aws.amazon.com/ec2/latest/instancetypes/ec2-instance-quotas.html">Amazon EC2 instance type quotas</a>.</p>
258 pub fn max_count(mut self, input: i32) -> Self {
259 self.inner = self.inner.max_count(input);
260 self
261 }
262 /// <p>The maximum number of instances to launch. If you specify a value that is more capacity than Amazon EC2 can launch in the target Availability Zone, Amazon EC2 launches the largest possible number of instances above the specified minimum count.</p>
263 /// <p>Constraints: Between 1 and the quota for the specified instance type for your account for this Region. For more information, see <a href="https://docs.aws.amazon.com/ec2/latest/instancetypes/ec2-instance-quotas.html">Amazon EC2 instance type quotas</a>.</p>
264 pub fn set_max_count(mut self, input: ::std::option::Option<i32>) -> Self {
265 self.inner = self.inner.set_max_count(input);
266 self
267 }
268 /// <p>The maximum number of instances to launch. If you specify a value that is more capacity than Amazon EC2 can launch in the target Availability Zone, Amazon EC2 launches the largest possible number of instances above the specified minimum count.</p>
269 /// <p>Constraints: Between 1 and the quota for the specified instance type for your account for this Region. For more information, see <a href="https://docs.aws.amazon.com/ec2/latest/instancetypes/ec2-instance-quotas.html">Amazon EC2 instance type quotas</a>.</p>
270 pub fn get_max_count(&self) -> &::std::option::Option<i32> {
271 self.inner.get_max_count()
272 }
273 /// <p>The minimum number of instances to launch. If you specify a value that is more capacity than Amazon EC2 can provide in the target Availability Zone, Amazon EC2 does not launch any instances.</p>
274 /// <p>Constraints: Between 1 and the quota for the specified instance type for your account for this Region. For more information, see <a href="https://docs.aws.amazon.com/ec2/latest/instancetypes/ec2-instance-quotas.html">Amazon EC2 instance type quotas</a>.</p>
275 pub fn min_count(mut self, input: i32) -> Self {
276 self.inner = self.inner.min_count(input);
277 self
278 }
279 /// <p>The minimum number of instances to launch. If you specify a value that is more capacity than Amazon EC2 can provide in the target Availability Zone, Amazon EC2 does not launch any instances.</p>
280 /// <p>Constraints: Between 1 and the quota for the specified instance type for your account for this Region. For more information, see <a href="https://docs.aws.amazon.com/ec2/latest/instancetypes/ec2-instance-quotas.html">Amazon EC2 instance type quotas</a>.</p>
281 pub fn set_min_count(mut self, input: ::std::option::Option<i32>) -> Self {
282 self.inner = self.inner.set_min_count(input);
283 self
284 }
285 /// <p>The minimum number of instances to launch. If you specify a value that is more capacity than Amazon EC2 can provide in the target Availability Zone, Amazon EC2 does not launch any instances.</p>
286 /// <p>Constraints: Between 1 and the quota for the specified instance type for your account for this Region. For more information, see <a href="https://docs.aws.amazon.com/ec2/latest/instancetypes/ec2-instance-quotas.html">Amazon EC2 instance type quotas</a>.</p>
287 pub fn get_min_count(&self) -> &::std::option::Option<i32> {
288 self.inner.get_min_count()
289 }
290 /// <p>Specifies whether detailed monitoring is enabled for the instance.</p>
291 pub fn monitoring(mut self, input: crate::types::RunInstancesMonitoringEnabled) -> Self {
292 self.inner = self.inner.monitoring(input);
293 self
294 }
295 /// <p>Specifies whether detailed monitoring is enabled for the instance.</p>
296 pub fn set_monitoring(mut self, input: ::std::option::Option<crate::types::RunInstancesMonitoringEnabled>) -> Self {
297 self.inner = self.inner.set_monitoring(input);
298 self
299 }
300 /// <p>Specifies whether detailed monitoring is enabled for the instance.</p>
301 pub fn get_monitoring(&self) -> &::std::option::Option<crate::types::RunInstancesMonitoringEnabled> {
302 self.inner.get_monitoring()
303 }
304 /// <p>The placement for the instance.</p>
305 pub fn placement(mut self, input: crate::types::Placement) -> Self {
306 self.inner = self.inner.placement(input);
307 self
308 }
309 /// <p>The placement for the instance.</p>
310 pub fn set_placement(mut self, input: ::std::option::Option<crate::types::Placement>) -> Self {
311 self.inner = self.inner.set_placement(input);
312 self
313 }
314 /// <p>The placement for the instance.</p>
315 pub fn get_placement(&self) -> &::std::option::Option<crate::types::Placement> {
316 self.inner.get_placement()
317 }
318 /// <p>The ID of the RAM disk to select. Some kernels require additional drivers at launch. Check the kernel requirements for information about whether you need to specify a RAM disk. To find kernel requirements, go to the Amazon Web Services Resource Center and search for the kernel ID.</p><important>
319 /// <p>We recommend that you use PV-GRUB instead of kernels and RAM disks. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/UserProvidedkernels.html">PV-GRUB</a> in the <i>Amazon EC2 User Guide</i>.</p>
320 /// </important>
321 pub fn ramdisk_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
322 self.inner = self.inner.ramdisk_id(input.into());
323 self
324 }
325 /// <p>The ID of the RAM disk to select. Some kernels require additional drivers at launch. Check the kernel requirements for information about whether you need to specify a RAM disk. To find kernel requirements, go to the Amazon Web Services Resource Center and search for the kernel ID.</p><important>
326 /// <p>We recommend that you use PV-GRUB instead of kernels and RAM disks. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/UserProvidedkernels.html">PV-GRUB</a> in the <i>Amazon EC2 User Guide</i>.</p>
327 /// </important>
328 pub fn set_ramdisk_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
329 self.inner = self.inner.set_ramdisk_id(input);
330 self
331 }
332 /// <p>The ID of the RAM disk to select. Some kernels require additional drivers at launch. Check the kernel requirements for information about whether you need to specify a RAM disk. To find kernel requirements, go to the Amazon Web Services Resource Center and search for the kernel ID.</p><important>
333 /// <p>We recommend that you use PV-GRUB instead of kernels and RAM disks. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/UserProvidedkernels.html">PV-GRUB</a> in the <i>Amazon EC2 User Guide</i>.</p>
334 /// </important>
335 pub fn get_ramdisk_id(&self) -> &::std::option::Option<::std::string::String> {
336 self.inner.get_ramdisk_id()
337 }
338 ///
339 /// Appends an item to `SecurityGroupIds`.
340 ///
341 /// To override the contents of this collection use [`set_security_group_ids`](Self::set_security_group_ids).
342 ///
343 /// <p>The IDs of the security groups.</p>
344 /// <p>If you specify a network interface, you must specify any security groups as part of the network interface instead of using this parameter.</p>
345 pub fn security_group_ids(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
346 self.inner = self.inner.security_group_ids(input.into());
347 self
348 }
349 /// <p>The IDs of the security groups.</p>
350 /// <p>If you specify a network interface, you must specify any security groups as part of the network interface instead of using this parameter.</p>
351 pub fn set_security_group_ids(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
352 self.inner = self.inner.set_security_group_ids(input);
353 self
354 }
355 /// <p>The IDs of the security groups.</p>
356 /// <p>If you specify a network interface, you must specify any security groups as part of the network interface instead of using this parameter.</p>
357 pub fn get_security_group_ids(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
358 self.inner.get_security_group_ids()
359 }
360 ///
361 /// Appends an item to `SecurityGroups`.
362 ///
363 /// To override the contents of this collection use [`set_security_groups`](Self::set_security_groups).
364 ///
365 /// <p>\[Default VPC\] The names of the security groups.</p>
366 /// <p>If you specify a network interface, you must specify any security groups as part of the network interface instead of using this parameter.</p>
367 /// <p>Default: Amazon EC2 uses the default security group.</p>
368 pub fn security_groups(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
369 self.inner = self.inner.security_groups(input.into());
370 self
371 }
372 /// <p>\[Default VPC\] The names of the security groups.</p>
373 /// <p>If you specify a network interface, you must specify any security groups as part of the network interface instead of using this parameter.</p>
374 /// <p>Default: Amazon EC2 uses the default security group.</p>
375 pub fn set_security_groups(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
376 self.inner = self.inner.set_security_groups(input);
377 self
378 }
379 /// <p>\[Default VPC\] The names of the security groups.</p>
380 /// <p>If you specify a network interface, you must specify any security groups as part of the network interface instead of using this parameter.</p>
381 /// <p>Default: Amazon EC2 uses the default security group.</p>
382 pub fn get_security_groups(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
383 self.inner.get_security_groups()
384 }
385 /// <p>The ID of the subnet to launch the instance into.</p>
386 /// <p>If you specify a network interface, you must specify any subnets as part of the network interface instead of using this parameter.</p>
387 pub fn subnet_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
388 self.inner = self.inner.subnet_id(input.into());
389 self
390 }
391 /// <p>The ID of the subnet to launch the instance into.</p>
392 /// <p>If you specify a network interface, you must specify any subnets as part of the network interface instead of using this parameter.</p>
393 pub fn set_subnet_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
394 self.inner = self.inner.set_subnet_id(input);
395 self
396 }
397 /// <p>The ID of the subnet to launch the instance into.</p>
398 /// <p>If you specify a network interface, you must specify any subnets as part of the network interface instead of using this parameter.</p>
399 pub fn get_subnet_id(&self) -> &::std::option::Option<::std::string::String> {
400 self.inner.get_subnet_id()
401 }
402 /// <p>The user data to make available to the instance. User data must be base64-encoded. Depending on the tool or SDK that you're using, the base64-encoding might be performed for you. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/user-data.html">Run commands at launch using instance user data</a>.</p>
403 pub fn user_data(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
404 self.inner = self.inner.user_data(input.into());
405 self
406 }
407 /// <p>The user data to make available to the instance. User data must be base64-encoded. Depending on the tool or SDK that you're using, the base64-encoding might be performed for you. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/user-data.html">Run commands at launch using instance user data</a>.</p>
408 pub fn set_user_data(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
409 self.inner = self.inner.set_user_data(input);
410 self
411 }
412 /// <p>The user data to make available to the instance. User data must be base64-encoded. Depending on the tool or SDK that you're using, the base64-encoding might be performed for you. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/user-data.html">Run commands at launch using instance user data</a>.</p>
413 pub fn get_user_data(&self) -> &::std::option::Option<::std::string::String> {
414 self.inner.get_user_data()
415 }
416 ///
417 /// Appends an item to `ElasticGpuSpecification`.
418 ///
419 /// To override the contents of this collection use [`set_elastic_gpu_specification`](Self::set_elastic_gpu_specification).
420 ///
421 /// <p>An elastic GPU to associate with the instance.</p><note>
422 /// <p>Amazon Elastic Graphics reached end of life on January 8, 2024.</p>
423 /// </note>
424 #[deprecated(
425 note = "Specifying Elastic Graphics accelerators is no longer supported on the RunInstances API.",
426 since = "2024-01-08"
427 )]
428 pub fn elastic_gpu_specification(mut self, input: crate::types::ElasticGpuSpecification) -> Self {
429 self.inner = self.inner.elastic_gpu_specification(input);
430 self
431 }
432 /// <p>An elastic GPU to associate with the instance.</p><note>
433 /// <p>Amazon Elastic Graphics reached end of life on January 8, 2024.</p>
434 /// </note>
435 #[deprecated(
436 note = "Specifying Elastic Graphics accelerators is no longer supported on the RunInstances API.",
437 since = "2024-01-08"
438 )]
439 pub fn set_elastic_gpu_specification(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::ElasticGpuSpecification>>) -> Self {
440 self.inner = self.inner.set_elastic_gpu_specification(input);
441 self
442 }
443 /// <p>An elastic GPU to associate with the instance.</p><note>
444 /// <p>Amazon Elastic Graphics reached end of life on January 8, 2024.</p>
445 /// </note>
446 #[deprecated(
447 note = "Specifying Elastic Graphics accelerators is no longer supported on the RunInstances API.",
448 since = "2024-01-08"
449 )]
450 pub fn get_elastic_gpu_specification(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::ElasticGpuSpecification>> {
451 self.inner.get_elastic_gpu_specification()
452 }
453 ///
454 /// Appends an item to `ElasticInferenceAccelerators`.
455 ///
456 /// To override the contents of this collection use [`set_elastic_inference_accelerators`](Self::set_elastic_inference_accelerators).
457 ///
458 /// <p>An elastic inference accelerator to associate with the instance.</p><note>
459 /// <p>Amazon Elastic Inference is no longer available.</p>
460 /// </note>
461 #[deprecated(
462 note = "Specifying Elastic Inference accelerators is no longer supported on the RunInstances API.",
463 since = "2024-01-08"
464 )]
465 pub fn elastic_inference_accelerators(mut self, input: crate::types::ElasticInferenceAccelerator) -> Self {
466 self.inner = self.inner.elastic_inference_accelerators(input);
467 self
468 }
469 /// <p>An elastic inference accelerator to associate with the instance.</p><note>
470 /// <p>Amazon Elastic Inference is no longer available.</p>
471 /// </note>
472 #[deprecated(
473 note = "Specifying Elastic Inference accelerators is no longer supported on the RunInstances API.",
474 since = "2024-01-08"
475 )]
476 pub fn set_elastic_inference_accelerators(
477 mut self,
478 input: ::std::option::Option<::std::vec::Vec<crate::types::ElasticInferenceAccelerator>>,
479 ) -> Self {
480 self.inner = self.inner.set_elastic_inference_accelerators(input);
481 self
482 }
483 /// <p>An elastic inference accelerator to associate with the instance.</p><note>
484 /// <p>Amazon Elastic Inference is no longer available.</p>
485 /// </note>
486 #[deprecated(
487 note = "Specifying Elastic Inference accelerators is no longer supported on the RunInstances API.",
488 since = "2024-01-08"
489 )]
490 pub fn get_elastic_inference_accelerators(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::ElasticInferenceAccelerator>> {
491 self.inner.get_elastic_inference_accelerators()
492 }
493 ///
494 /// Appends an item to `TagSpecifications`.
495 ///
496 /// To override the contents of this collection use [`set_tag_specifications`](Self::set_tag_specifications).
497 ///
498 /// <p>The tags to apply to the resources that are created during instance launch.</p>
499 /// <p>You can specify tags for the following resources only:</p>
500 /// <ul>
501 /// <li>
502 /// <p>Instances</p></li>
503 /// <li>
504 /// <p>Volumes</p></li>
505 /// <li>
506 /// <p>Spot Instance requests</p></li>
507 /// <li>
508 /// <p>Network interfaces</p></li>
509 /// </ul>
510 /// <p>To tag a resource after it has been created, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreateTags.html">CreateTags</a>.</p>
511 pub fn tag_specifications(mut self, input: crate::types::TagSpecification) -> Self {
512 self.inner = self.inner.tag_specifications(input);
513 self
514 }
515 /// <p>The tags to apply to the resources that are created during instance launch.</p>
516 /// <p>You can specify tags for the following resources only:</p>
517 /// <ul>
518 /// <li>
519 /// <p>Instances</p></li>
520 /// <li>
521 /// <p>Volumes</p></li>
522 /// <li>
523 /// <p>Spot Instance requests</p></li>
524 /// <li>
525 /// <p>Network interfaces</p></li>
526 /// </ul>
527 /// <p>To tag a resource after it has been created, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreateTags.html">CreateTags</a>.</p>
528 pub fn set_tag_specifications(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::TagSpecification>>) -> Self {
529 self.inner = self.inner.set_tag_specifications(input);
530 self
531 }
532 /// <p>The tags to apply to the resources that are created during instance launch.</p>
533 /// <p>You can specify tags for the following resources only:</p>
534 /// <ul>
535 /// <li>
536 /// <p>Instances</p></li>
537 /// <li>
538 /// <p>Volumes</p></li>
539 /// <li>
540 /// <p>Spot Instance requests</p></li>
541 /// <li>
542 /// <p>Network interfaces</p></li>
543 /// </ul>
544 /// <p>To tag a resource after it has been created, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreateTags.html">CreateTags</a>.</p>
545 pub fn get_tag_specifications(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::TagSpecification>> {
546 self.inner.get_tag_specifications()
547 }
548 /// <p>The launch template. Any additional parameters that you specify for the new instance overwrite the corresponding parameters included in the launch template.</p>
549 pub fn launch_template(mut self, input: crate::types::LaunchTemplateSpecification) -> Self {
550 self.inner = self.inner.launch_template(input);
551 self
552 }
553 /// <p>The launch template. Any additional parameters that you specify for the new instance overwrite the corresponding parameters included in the launch template.</p>
554 pub fn set_launch_template(mut self, input: ::std::option::Option<crate::types::LaunchTemplateSpecification>) -> Self {
555 self.inner = self.inner.set_launch_template(input);
556 self
557 }
558 /// <p>The launch template. Any additional parameters that you specify for the new instance overwrite the corresponding parameters included in the launch template.</p>
559 pub fn get_launch_template(&self) -> &::std::option::Option<crate::types::LaunchTemplateSpecification> {
560 self.inner.get_launch_template()
561 }
562 /// <p>The market (purchasing) option for the instances.</p>
563 /// <p>For <code>RunInstances</code>, persistent Spot Instance requests are only supported when <b>InstanceInterruptionBehavior</b> is set to either <code>hibernate</code> or <code>stop</code>.</p>
564 pub fn instance_market_options(mut self, input: crate::types::InstanceMarketOptionsRequest) -> Self {
565 self.inner = self.inner.instance_market_options(input);
566 self
567 }
568 /// <p>The market (purchasing) option for the instances.</p>
569 /// <p>For <code>RunInstances</code>, persistent Spot Instance requests are only supported when <b>InstanceInterruptionBehavior</b> is set to either <code>hibernate</code> or <code>stop</code>.</p>
570 pub fn set_instance_market_options(mut self, input: ::std::option::Option<crate::types::InstanceMarketOptionsRequest>) -> Self {
571 self.inner = self.inner.set_instance_market_options(input);
572 self
573 }
574 /// <p>The market (purchasing) option for the instances.</p>
575 /// <p>For <code>RunInstances</code>, persistent Spot Instance requests are only supported when <b>InstanceInterruptionBehavior</b> is set to either <code>hibernate</code> or <code>stop</code>.</p>
576 pub fn get_instance_market_options(&self) -> &::std::option::Option<crate::types::InstanceMarketOptionsRequest> {
577 self.inner.get_instance_market_options()
578 }
579 /// <p>The credit option for CPU usage of the burstable performance instance. Valid values are <code>standard</code> and <code>unlimited</code>. To change this attribute after launch, use <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_ModifyInstanceCreditSpecification.html"> ModifyInstanceCreditSpecification</a>. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/burstable-performance-instances.html">Burstable performance instances</a> in the <i>Amazon EC2 User Guide</i>.</p>
580 /// <p>Default: <code>standard</code> (T2 instances) or <code>unlimited</code> (T3/T3a/T4g instances)</p>
581 /// <p>For T3 instances with <code>host</code> tenancy, only <code>standard</code> is supported.</p>
582 pub fn credit_specification(mut self, input: crate::types::CreditSpecificationRequest) -> Self {
583 self.inner = self.inner.credit_specification(input);
584 self
585 }
586 /// <p>The credit option for CPU usage of the burstable performance instance. Valid values are <code>standard</code> and <code>unlimited</code>. To change this attribute after launch, use <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_ModifyInstanceCreditSpecification.html"> ModifyInstanceCreditSpecification</a>. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/burstable-performance-instances.html">Burstable performance instances</a> in the <i>Amazon EC2 User Guide</i>.</p>
587 /// <p>Default: <code>standard</code> (T2 instances) or <code>unlimited</code> (T3/T3a/T4g instances)</p>
588 /// <p>For T3 instances with <code>host</code> tenancy, only <code>standard</code> is supported.</p>
589 pub fn set_credit_specification(mut self, input: ::std::option::Option<crate::types::CreditSpecificationRequest>) -> Self {
590 self.inner = self.inner.set_credit_specification(input);
591 self
592 }
593 /// <p>The credit option for CPU usage of the burstable performance instance. Valid values are <code>standard</code> and <code>unlimited</code>. To change this attribute after launch, use <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_ModifyInstanceCreditSpecification.html"> ModifyInstanceCreditSpecification</a>. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/burstable-performance-instances.html">Burstable performance instances</a> in the <i>Amazon EC2 User Guide</i>.</p>
594 /// <p>Default: <code>standard</code> (T2 instances) or <code>unlimited</code> (T3/T3a/T4g instances)</p>
595 /// <p>For T3 instances with <code>host</code> tenancy, only <code>standard</code> is supported.</p>
596 pub fn get_credit_specification(&self) -> &::std::option::Option<crate::types::CreditSpecificationRequest> {
597 self.inner.get_credit_specification()
598 }
599 /// <p>The CPU options for the instance. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-optimize-cpu.html">Optimize CPU options</a> in the <i>Amazon EC2 User Guide</i>.</p>
600 pub fn cpu_options(mut self, input: crate::types::CpuOptionsRequest) -> Self {
601 self.inner = self.inner.cpu_options(input);
602 self
603 }
604 /// <p>The CPU options for the instance. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-optimize-cpu.html">Optimize CPU options</a> in the <i>Amazon EC2 User Guide</i>.</p>
605 pub fn set_cpu_options(mut self, input: ::std::option::Option<crate::types::CpuOptionsRequest>) -> Self {
606 self.inner = self.inner.set_cpu_options(input);
607 self
608 }
609 /// <p>The CPU options for the instance. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-optimize-cpu.html">Optimize CPU options</a> in the <i>Amazon EC2 User Guide</i>.</p>
610 pub fn get_cpu_options(&self) -> &::std::option::Option<crate::types::CpuOptionsRequest> {
611 self.inner.get_cpu_options()
612 }
613 /// <p>Information about the Capacity Reservation targeting option. If you do not specify this parameter, the instance's Capacity Reservation preference defaults to <code>open</code>, which enables it to run in any open Capacity Reservation that has matching attributes (instance type, platform, Availability Zone, and tenancy).</p>
614 pub fn capacity_reservation_specification(mut self, input: crate::types::CapacityReservationSpecification) -> Self {
615 self.inner = self.inner.capacity_reservation_specification(input);
616 self
617 }
618 /// <p>Information about the Capacity Reservation targeting option. If you do not specify this parameter, the instance's Capacity Reservation preference defaults to <code>open</code>, which enables it to run in any open Capacity Reservation that has matching attributes (instance type, platform, Availability Zone, and tenancy).</p>
619 pub fn set_capacity_reservation_specification(mut self, input: ::std::option::Option<crate::types::CapacityReservationSpecification>) -> Self {
620 self.inner = self.inner.set_capacity_reservation_specification(input);
621 self
622 }
623 /// <p>Information about the Capacity Reservation targeting option. If you do not specify this parameter, the instance's Capacity Reservation preference defaults to <code>open</code>, which enables it to run in any open Capacity Reservation that has matching attributes (instance type, platform, Availability Zone, and tenancy).</p>
624 pub fn get_capacity_reservation_specification(&self) -> &::std::option::Option<crate::types::CapacityReservationSpecification> {
625 self.inner.get_capacity_reservation_specification()
626 }
627 /// <p>Indicates whether an instance is enabled for hibernation. This parameter is valid only if the instance meets the <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/hibernating-prerequisites.html">hibernation prerequisites</a>. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Hibernate.html">Hibernate your Amazon EC2 instance</a> in the <i>Amazon EC2 User Guide</i>.</p>
628 /// <p>You can't enable hibernation and Amazon Web Services Nitro Enclaves on the same instance.</p>
629 pub fn hibernation_options(mut self, input: crate::types::HibernationOptionsRequest) -> Self {
630 self.inner = self.inner.hibernation_options(input);
631 self
632 }
633 /// <p>Indicates whether an instance is enabled for hibernation. This parameter is valid only if the instance meets the <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/hibernating-prerequisites.html">hibernation prerequisites</a>. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Hibernate.html">Hibernate your Amazon EC2 instance</a> in the <i>Amazon EC2 User Guide</i>.</p>
634 /// <p>You can't enable hibernation and Amazon Web Services Nitro Enclaves on the same instance.</p>
635 pub fn set_hibernation_options(mut self, input: ::std::option::Option<crate::types::HibernationOptionsRequest>) -> Self {
636 self.inner = self.inner.set_hibernation_options(input);
637 self
638 }
639 /// <p>Indicates whether an instance is enabled for hibernation. This parameter is valid only if the instance meets the <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/hibernating-prerequisites.html">hibernation prerequisites</a>. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Hibernate.html">Hibernate your Amazon EC2 instance</a> in the <i>Amazon EC2 User Guide</i>.</p>
640 /// <p>You can't enable hibernation and Amazon Web Services Nitro Enclaves on the same instance.</p>
641 pub fn get_hibernation_options(&self) -> &::std::option::Option<crate::types::HibernationOptionsRequest> {
642 self.inner.get_hibernation_options()
643 }
644 ///
645 /// Appends an item to `LicenseSpecifications`.
646 ///
647 /// To override the contents of this collection use [`set_license_specifications`](Self::set_license_specifications).
648 ///
649 /// <p>The license configurations.</p>
650 pub fn license_specifications(mut self, input: crate::types::LicenseConfigurationRequest) -> Self {
651 self.inner = self.inner.license_specifications(input);
652 self
653 }
654 /// <p>The license configurations.</p>
655 pub fn set_license_specifications(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::LicenseConfigurationRequest>>) -> Self {
656 self.inner = self.inner.set_license_specifications(input);
657 self
658 }
659 /// <p>The license configurations.</p>
660 pub fn get_license_specifications(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::LicenseConfigurationRequest>> {
661 self.inner.get_license_specifications()
662 }
663 /// <p>The metadata options for the instance. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/configuring-instance-metadata-options.html">Configure the Instance Metadata Service options</a>.</p>
664 pub fn metadata_options(mut self, input: crate::types::InstanceMetadataOptionsRequest) -> Self {
665 self.inner = self.inner.metadata_options(input);
666 self
667 }
668 /// <p>The metadata options for the instance. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/configuring-instance-metadata-options.html">Configure the Instance Metadata Service options</a>.</p>
669 pub fn set_metadata_options(mut self, input: ::std::option::Option<crate::types::InstanceMetadataOptionsRequest>) -> Self {
670 self.inner = self.inner.set_metadata_options(input);
671 self
672 }
673 /// <p>The metadata options for the instance. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/configuring-instance-metadata-options.html">Configure the Instance Metadata Service options</a>.</p>
674 pub fn get_metadata_options(&self) -> &::std::option::Option<crate::types::InstanceMetadataOptionsRequest> {
675 self.inner.get_metadata_options()
676 }
677 /// <p>Indicates whether the instance is enabled for Amazon Web Services Nitro Enclaves. For more information, see <a href="https://docs.aws.amazon.com/enclaves/latest/user/">Amazon Web Services Nitro Enclaves User Guide</a>.</p>
678 /// <p>You can't enable Amazon Web Services Nitro Enclaves and hibernation on the same instance.</p>
679 pub fn enclave_options(mut self, input: crate::types::EnclaveOptionsRequest) -> Self {
680 self.inner = self.inner.enclave_options(input);
681 self
682 }
683 /// <p>Indicates whether the instance is enabled for Amazon Web Services Nitro Enclaves. For more information, see <a href="https://docs.aws.amazon.com/enclaves/latest/user/">Amazon Web Services Nitro Enclaves User Guide</a>.</p>
684 /// <p>You can't enable Amazon Web Services Nitro Enclaves and hibernation on the same instance.</p>
685 pub fn set_enclave_options(mut self, input: ::std::option::Option<crate::types::EnclaveOptionsRequest>) -> Self {
686 self.inner = self.inner.set_enclave_options(input);
687 self
688 }
689 /// <p>Indicates whether the instance is enabled for Amazon Web Services Nitro Enclaves. For more information, see <a href="https://docs.aws.amazon.com/enclaves/latest/user/">Amazon Web Services Nitro Enclaves User Guide</a>.</p>
690 /// <p>You can't enable Amazon Web Services Nitro Enclaves and hibernation on the same instance.</p>
691 pub fn get_enclave_options(&self) -> &::std::option::Option<crate::types::EnclaveOptionsRequest> {
692 self.inner.get_enclave_options()
693 }
694 /// <p>The options for the instance hostname. The default values are inherited from the subnet. Applies only if creating a network interface, not attaching an existing one.</p>
695 pub fn private_dns_name_options(mut self, input: crate::types::PrivateDnsNameOptionsRequest) -> Self {
696 self.inner = self.inner.private_dns_name_options(input);
697 self
698 }
699 /// <p>The options for the instance hostname. The default values are inherited from the subnet. Applies only if creating a network interface, not attaching an existing one.</p>
700 pub fn set_private_dns_name_options(mut self, input: ::std::option::Option<crate::types::PrivateDnsNameOptionsRequest>) -> Self {
701 self.inner = self.inner.set_private_dns_name_options(input);
702 self
703 }
704 /// <p>The options for the instance hostname. The default values are inherited from the subnet. Applies only if creating a network interface, not attaching an existing one.</p>
705 pub fn get_private_dns_name_options(&self) -> &::std::option::Option<crate::types::PrivateDnsNameOptionsRequest> {
706 self.inner.get_private_dns_name_options()
707 }
708 /// <p>The maintenance and recovery options for the instance.</p>
709 pub fn maintenance_options(mut self, input: crate::types::InstanceMaintenanceOptionsRequest) -> Self {
710 self.inner = self.inner.maintenance_options(input);
711 self
712 }
713 /// <p>The maintenance and recovery options for the instance.</p>
714 pub fn set_maintenance_options(mut self, input: ::std::option::Option<crate::types::InstanceMaintenanceOptionsRequest>) -> Self {
715 self.inner = self.inner.set_maintenance_options(input);
716 self
717 }
718 /// <p>The maintenance and recovery options for the instance.</p>
719 pub fn get_maintenance_options(&self) -> &::std::option::Option<crate::types::InstanceMaintenanceOptionsRequest> {
720 self.inner.get_maintenance_options()
721 }
722 /// <p>Indicates whether an instance is enabled for stop protection. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-stop-protection.html">Enable stop protection for your EC2 instances</a>.</p>
723 pub fn disable_api_stop(mut self, input: bool) -> Self {
724 self.inner = self.inner.disable_api_stop(input);
725 self
726 }
727 /// <p>Indicates whether an instance is enabled for stop protection. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-stop-protection.html">Enable stop protection for your EC2 instances</a>.</p>
728 pub fn set_disable_api_stop(mut self, input: ::std::option::Option<bool>) -> Self {
729 self.inner = self.inner.set_disable_api_stop(input);
730 self
731 }
732 /// <p>Indicates whether an instance is enabled for stop protection. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-stop-protection.html">Enable stop protection for your EC2 instances</a>.</p>
733 pub fn get_disable_api_stop(&self) -> &::std::option::Option<bool> {
734 self.inner.get_disable_api_stop()
735 }
736 /// <p>If you’re launching an instance into a dual-stack or IPv6-only subnet, you can enable assigning a primary IPv6 address. A primary IPv6 address is an IPv6 GUA address associated with an ENI that you have enabled to use a primary IPv6 address. Use this option if an instance relies on its IPv6 address not changing. When you launch the instance, Amazon Web Services will automatically assign an IPv6 address associated with the ENI attached to your instance to be the primary IPv6 address. Once you enable an IPv6 GUA address to be a primary IPv6, you cannot disable it. When you enable an IPv6 GUA address to be a primary IPv6, the first IPv6 GUA will be made the primary IPv6 address until the instance is terminated or the network interface is detached. If you have multiple IPv6 addresses associated with an ENI attached to your instance and you enable a primary IPv6 address, the first IPv6 GUA address associated with the ENI becomes the primary IPv6 address.</p>
737 pub fn enable_primary_ipv6(mut self, input: bool) -> Self {
738 self.inner = self.inner.enable_primary_ipv6(input);
739 self
740 }
741 /// <p>If you’re launching an instance into a dual-stack or IPv6-only subnet, you can enable assigning a primary IPv6 address. A primary IPv6 address is an IPv6 GUA address associated with an ENI that you have enabled to use a primary IPv6 address. Use this option if an instance relies on its IPv6 address not changing. When you launch the instance, Amazon Web Services will automatically assign an IPv6 address associated with the ENI attached to your instance to be the primary IPv6 address. Once you enable an IPv6 GUA address to be a primary IPv6, you cannot disable it. When you enable an IPv6 GUA address to be a primary IPv6, the first IPv6 GUA will be made the primary IPv6 address until the instance is terminated or the network interface is detached. If you have multiple IPv6 addresses associated with an ENI attached to your instance and you enable a primary IPv6 address, the first IPv6 GUA address associated with the ENI becomes the primary IPv6 address.</p>
742 pub fn set_enable_primary_ipv6(mut self, input: ::std::option::Option<bool>) -> Self {
743 self.inner = self.inner.set_enable_primary_ipv6(input);
744 self
745 }
746 /// <p>If you’re launching an instance into a dual-stack or IPv6-only subnet, you can enable assigning a primary IPv6 address. A primary IPv6 address is an IPv6 GUA address associated with an ENI that you have enabled to use a primary IPv6 address. Use this option if an instance relies on its IPv6 address not changing. When you launch the instance, Amazon Web Services will automatically assign an IPv6 address associated with the ENI attached to your instance to be the primary IPv6 address. Once you enable an IPv6 GUA address to be a primary IPv6, you cannot disable it. When you enable an IPv6 GUA address to be a primary IPv6, the first IPv6 GUA will be made the primary IPv6 address until the instance is terminated or the network interface is detached. If you have multiple IPv6 addresses associated with an ENI attached to your instance and you enable a primary IPv6 address, the first IPv6 GUA address associated with the ENI becomes the primary IPv6 address.</p>
747 pub fn get_enable_primary_ipv6(&self) -> &::std::option::Option<bool> {
748 self.inner.get_enable_primary_ipv6()
749 }
750 /// <p>Contains settings for the network performance options for the instance.</p>
751 pub fn network_performance_options(mut self, input: crate::types::InstanceNetworkPerformanceOptionsRequest) -> Self {
752 self.inner = self.inner.network_performance_options(input);
753 self
754 }
755 /// <p>Contains settings for the network performance options for the instance.</p>
756 pub fn set_network_performance_options(mut self, input: ::std::option::Option<crate::types::InstanceNetworkPerformanceOptionsRequest>) -> Self {
757 self.inner = self.inner.set_network_performance_options(input);
758 self
759 }
760 /// <p>Contains settings for the network performance options for the instance.</p>
761 pub fn get_network_performance_options(&self) -> &::std::option::Option<crate::types::InstanceNetworkPerformanceOptionsRequest> {
762 self.inner.get_network_performance_options()
763 }
764 /// <p>Reserved for internal use.</p>
765 pub fn operator(mut self, input: crate::types::OperatorRequest) -> Self {
766 self.inner = self.inner.operator(input);
767 self
768 }
769 /// <p>Reserved for internal use.</p>
770 pub fn set_operator(mut self, input: ::std::option::Option<crate::types::OperatorRequest>) -> Self {
771 self.inner = self.inner.set_operator(input);
772 self
773 }
774 /// <p>Reserved for internal use.</p>
775 pub fn get_operator(&self) -> &::std::option::Option<crate::types::OperatorRequest> {
776 self.inner.get_operator()
777 }
778 /// <p>Checks whether you have the required permissions for the operation, 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>
779 pub fn dry_run(mut self, input: bool) -> Self {
780 self.inner = self.inner.dry_run(input);
781 self
782 }
783 /// <p>Checks whether you have the required permissions for the operation, 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>
784 pub fn set_dry_run(mut self, input: ::std::option::Option<bool>) -> Self {
785 self.inner = self.inner.set_dry_run(input);
786 self
787 }
788 /// <p>Checks whether you have the required permissions for the operation, 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>
789 pub fn get_dry_run(&self) -> &::std::option::Option<bool> {
790 self.inner.get_dry_run()
791 }
792 /// <p>Indicates whether termination protection is enabled for the instance. The default is <code>false</code>, which means that you can terminate the instance using the Amazon EC2 console, command line tools, or API. You can enable termination protection when you launch an instance, while the instance is running, or while the instance is stopped.</p>
793 pub fn disable_api_termination(mut self, input: bool) -> Self {
794 self.inner = self.inner.disable_api_termination(input);
795 self
796 }
797 /// <p>Indicates whether termination protection is enabled for the instance. The default is <code>false</code>, which means that you can terminate the instance using the Amazon EC2 console, command line tools, or API. You can enable termination protection when you launch an instance, while the instance is running, or while the instance is stopped.</p>
798 pub fn set_disable_api_termination(mut self, input: ::std::option::Option<bool>) -> Self {
799 self.inner = self.inner.set_disable_api_termination(input);
800 self
801 }
802 /// <p>Indicates whether termination protection is enabled for the instance. The default is <code>false</code>, which means that you can terminate the instance using the Amazon EC2 console, command line tools, or API. You can enable termination protection when you launch an instance, while the instance is running, or while the instance is stopped.</p>
803 pub fn get_disable_api_termination(&self) -> &::std::option::Option<bool> {
804 self.inner.get_disable_api_termination()
805 }
806 /// <p>Indicates whether an instance stops or terminates when you initiate shutdown from the instance (using the operating system command for system shutdown).</p>
807 /// <p>Default: <code>stop</code></p>
808 pub fn instance_initiated_shutdown_behavior(mut self, input: crate::types::ShutdownBehavior) -> Self {
809 self.inner = self.inner.instance_initiated_shutdown_behavior(input);
810 self
811 }
812 /// <p>Indicates whether an instance stops or terminates when you initiate shutdown from the instance (using the operating system command for system shutdown).</p>
813 /// <p>Default: <code>stop</code></p>
814 pub fn set_instance_initiated_shutdown_behavior(mut self, input: ::std::option::Option<crate::types::ShutdownBehavior>) -> Self {
815 self.inner = self.inner.set_instance_initiated_shutdown_behavior(input);
816 self
817 }
818 /// <p>Indicates whether an instance stops or terminates when you initiate shutdown from the instance (using the operating system command for system shutdown).</p>
819 /// <p>Default: <code>stop</code></p>
820 pub fn get_instance_initiated_shutdown_behavior(&self) -> &::std::option::Option<crate::types::ShutdownBehavior> {
821 self.inner.get_instance_initiated_shutdown_behavior()
822 }
823 /// <p>The primary IPv4 address. You must specify a value from the IPv4 address range of the subnet.</p>
824 /// <p>Only one private IP address can be designated as primary. You can't specify this option if you've specified the option to designate a private IP address as the primary IP address in a network interface specification. You cannot specify this option if you're launching more than one instance in the request.</p>
825 /// <p>You cannot specify this option and the network interfaces option in the same request.</p>
826 pub fn private_ip_address(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
827 self.inner = self.inner.private_ip_address(input.into());
828 self
829 }
830 /// <p>The primary IPv4 address. You must specify a value from the IPv4 address range of the subnet.</p>
831 /// <p>Only one private IP address can be designated as primary. You can't specify this option if you've specified the option to designate a private IP address as the primary IP address in a network interface specification. You cannot specify this option if you're launching more than one instance in the request.</p>
832 /// <p>You cannot specify this option and the network interfaces option in the same request.</p>
833 pub fn set_private_ip_address(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
834 self.inner = self.inner.set_private_ip_address(input);
835 self
836 }
837 /// <p>The primary IPv4 address. You must specify a value from the IPv4 address range of the subnet.</p>
838 /// <p>Only one private IP address can be designated as primary. You can't specify this option if you've specified the option to designate a private IP address as the primary IP address in a network interface specification. You cannot specify this option if you're launching more than one instance in the request.</p>
839 /// <p>You cannot specify this option and the network interfaces option in the same request.</p>
840 pub fn get_private_ip_address(&self) -> &::std::option::Option<::std::string::String> {
841 self.inner.get_private_ip_address()
842 }
843 /// <p>Unique, case-sensitive identifier 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>
844 /// <p>For more information, see <a href="https://docs.aws.amazon.com/ec2/latest/devguide/ec2-api-idempotency.html">Ensuring idempotency in Amazon EC2 API requests</a>.</p>
845 /// <p>Constraints: Maximum 64 ASCII characters</p>
846 pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
847 self.inner = self.inner.client_token(input.into());
848 self
849 }
850 /// <p>Unique, case-sensitive identifier 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>
851 /// <p>For more information, see <a href="https://docs.aws.amazon.com/ec2/latest/devguide/ec2-api-idempotency.html">Ensuring idempotency in Amazon EC2 API requests</a>.</p>
852 /// <p>Constraints: Maximum 64 ASCII characters</p>
853 pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
854 self.inner = self.inner.set_client_token(input);
855 self
856 }
857 /// <p>Unique, case-sensitive identifier 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>
858 /// <p>For more information, see <a href="https://docs.aws.amazon.com/ec2/latest/devguide/ec2-api-idempotency.html">Ensuring idempotency in Amazon EC2 API requests</a>.</p>
859 /// <p>Constraints: Maximum 64 ASCII characters</p>
860 pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
861 self.inner.get_client_token()
862 }
863 /// <p>Reserved.</p>
864 pub fn additional_info(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
865 self.inner = self.inner.additional_info(input.into());
866 self
867 }
868 /// <p>Reserved.</p>
869 pub fn set_additional_info(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
870 self.inner = self.inner.set_additional_info(input);
871 self
872 }
873 /// <p>Reserved.</p>
874 pub fn get_additional_info(&self) -> &::std::option::Option<::std::string::String> {
875 self.inner.get_additional_info()
876 }
877 ///
878 /// Appends an item to `NetworkInterfaces`.
879 ///
880 /// To override the contents of this collection use [`set_network_interfaces`](Self::set_network_interfaces).
881 ///
882 /// <p>The network interfaces to associate with the instance.</p>
883 pub fn network_interfaces(mut self, input: crate::types::InstanceNetworkInterfaceSpecification) -> Self {
884 self.inner = self.inner.network_interfaces(input);
885 self
886 }
887 /// <p>The network interfaces to associate with the instance.</p>
888 pub fn set_network_interfaces(
889 mut self,
890 input: ::std::option::Option<::std::vec::Vec<crate::types::InstanceNetworkInterfaceSpecification>>,
891 ) -> Self {
892 self.inner = self.inner.set_network_interfaces(input);
893 self
894 }
895 /// <p>The network interfaces to associate with the instance.</p>
896 pub fn get_network_interfaces(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::InstanceNetworkInterfaceSpecification>> {
897 self.inner.get_network_interfaces()
898 }
899 /// <p>The name or Amazon Resource Name (ARN) of an IAM instance profile.</p>
900 pub fn iam_instance_profile(mut self, input: crate::types::IamInstanceProfileSpecification) -> Self {
901 self.inner = self.inner.iam_instance_profile(input);
902 self
903 }
904 /// <p>The name or Amazon Resource Name (ARN) of an IAM instance profile.</p>
905 pub fn set_iam_instance_profile(mut self, input: ::std::option::Option<crate::types::IamInstanceProfileSpecification>) -> Self {
906 self.inner = self.inner.set_iam_instance_profile(input);
907 self
908 }
909 /// <p>The name or Amazon Resource Name (ARN) of an IAM instance profile.</p>
910 pub fn get_iam_instance_profile(&self) -> &::std::option::Option<crate::types::IamInstanceProfileSpecification> {
911 self.inner.get_iam_instance_profile()
912 }
913 /// <p>Indicates whether the instance is optimized for Amazon EBS I/O. This optimization provides dedicated throughput to Amazon EBS and an optimized configuration stack to provide optimal Amazon EBS I/O performance. This optimization isn't available with all instance types. Additional usage charges apply when using an EBS-optimized instance.</p>
914 /// <p>Default: <code>false</code></p>
915 pub fn ebs_optimized(mut self, input: bool) -> Self {
916 self.inner = self.inner.ebs_optimized(input);
917 self
918 }
919 /// <p>Indicates whether the instance is optimized for Amazon EBS I/O. This optimization provides dedicated throughput to Amazon EBS and an optimized configuration stack to provide optimal Amazon EBS I/O performance. This optimization isn't available with all instance types. Additional usage charges apply when using an EBS-optimized instance.</p>
920 /// <p>Default: <code>false</code></p>
921 pub fn set_ebs_optimized(mut self, input: ::std::option::Option<bool>) -> Self {
922 self.inner = self.inner.set_ebs_optimized(input);
923 self
924 }
925 /// <p>Indicates whether the instance is optimized for Amazon EBS I/O. This optimization provides dedicated throughput to Amazon EBS and an optimized configuration stack to provide optimal Amazon EBS I/O performance. This optimization isn't available with all instance types. Additional usage charges apply when using an EBS-optimized instance.</p>
926 /// <p>Default: <code>false</code></p>
927 pub fn get_ebs_optimized(&self) -> &::std::option::Option<bool> {
928 self.inner.get_ebs_optimized()
929 }
930}