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/AWSEC2/latest/UserGuide/instance-types.html">Amazon EC2 instance types</a> in the <i>Amazon EC2 User Guide</i>.</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/AWSEC2/latest/UserGuide/instance-types.html">Amazon EC2 instance types</a> in the <i>Amazon EC2 User Guide</i>.</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/AWSEC2/latest/UserGuide/instance-types.html">Amazon EC2 instance types</a> in the <i>Amazon EC2 User Guide</i>.</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. You can create a key pair using <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreateKeyPair.html">CreateKeyPair</a> or <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_ImportKeyPair.html">ImportKeyPair</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. You can create a key pair using <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreateKeyPair.html">CreateKeyPair</a> or <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_ImportKeyPair.html">ImportKeyPair</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. You can create a key pair using <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreateKeyPair.html">CreateKeyPair</a> or <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_ImportKeyPair.html">ImportKeyPair</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. You can create a security group using <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreateSecurityGroup.html">CreateSecurityGroup</a>.</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. You can create a security group using <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreateSecurityGroup.html">CreateSecurityGroup</a>.</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. You can create a security group using <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreateSecurityGroup.html">CreateSecurityGroup</a>.</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/instancedata-add-user-data.html">Work with 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/instancedata-add-user-data.html">Work with 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/instancedata-add-user-data.html">Work with 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 pub fn elastic_gpu_specification(mut self, input: crate::types::ElasticGpuSpecification) -> Self {
425 self.inner = self.inner.elastic_gpu_specification(input);
426 self
427 }
428 /// <p>An elastic GPU to associate with the instance.</p><note>
429 /// <p>Amazon Elastic Graphics reached end of life on January 8, 2024.</p>
430 /// </note>
431 pub fn set_elastic_gpu_specification(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::ElasticGpuSpecification>>) -> Self {
432 self.inner = self.inner.set_elastic_gpu_specification(input);
433 self
434 }
435 /// <p>An elastic GPU to associate with the instance.</p><note>
436 /// <p>Amazon Elastic Graphics reached end of life on January 8, 2024.</p>
437 /// </note>
438 pub fn get_elastic_gpu_specification(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::ElasticGpuSpecification>> {
439 self.inner.get_elastic_gpu_specification()
440 }
441 ///
442 /// Appends an item to `ElasticInferenceAccelerators`.
443 ///
444 /// To override the contents of this collection use [`set_elastic_inference_accelerators`](Self::set_elastic_inference_accelerators).
445 ///
446 /// <p>An elastic inference accelerator to associate with the instance.</p><note>
447 /// <p>Amazon Elastic Inference is no longer available.</p>
448 /// </note>
449 pub fn elastic_inference_accelerators(mut self, input: crate::types::ElasticInferenceAccelerator) -> Self {
450 self.inner = self.inner.elastic_inference_accelerators(input);
451 self
452 }
453 /// <p>An elastic inference accelerator to associate with the instance.</p><note>
454 /// <p>Amazon Elastic Inference is no longer available.</p>
455 /// </note>
456 pub fn set_elastic_inference_accelerators(
457 mut self,
458 input: ::std::option::Option<::std::vec::Vec<crate::types::ElasticInferenceAccelerator>>,
459 ) -> Self {
460 self.inner = self.inner.set_elastic_inference_accelerators(input);
461 self
462 }
463 /// <p>An elastic inference accelerator to associate with the instance.</p><note>
464 /// <p>Amazon Elastic Inference is no longer available.</p>
465 /// </note>
466 pub fn get_elastic_inference_accelerators(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::ElasticInferenceAccelerator>> {
467 self.inner.get_elastic_inference_accelerators()
468 }
469 ///
470 /// Appends an item to `TagSpecifications`.
471 ///
472 /// To override the contents of this collection use [`set_tag_specifications`](Self::set_tag_specifications).
473 ///
474 /// <p>The tags to apply to the resources that are created during instance launch.</p>
475 /// <p>You can specify tags for the following resources only:</p>
476 /// <ul>
477 /// <li>
478 /// <p>Instances</p></li>
479 /// <li>
480 /// <p>Volumes</p></li>
481 /// <li>
482 /// <p>Spot Instance requests</p></li>
483 /// <li>
484 /// <p>Network interfaces</p></li>
485 /// </ul>
486 /// <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>
487 pub fn tag_specifications(mut self, input: crate::types::TagSpecification) -> Self {
488 self.inner = self.inner.tag_specifications(input);
489 self
490 }
491 /// <p>The tags to apply to the resources that are created during instance launch.</p>
492 /// <p>You can specify tags for the following resources only:</p>
493 /// <ul>
494 /// <li>
495 /// <p>Instances</p></li>
496 /// <li>
497 /// <p>Volumes</p></li>
498 /// <li>
499 /// <p>Spot Instance requests</p></li>
500 /// <li>
501 /// <p>Network interfaces</p></li>
502 /// </ul>
503 /// <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>
504 pub fn set_tag_specifications(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::TagSpecification>>) -> Self {
505 self.inner = self.inner.set_tag_specifications(input);
506 self
507 }
508 /// <p>The tags to apply to the resources that are created during instance launch.</p>
509 /// <p>You can specify tags for the following resources only:</p>
510 /// <ul>
511 /// <li>
512 /// <p>Instances</p></li>
513 /// <li>
514 /// <p>Volumes</p></li>
515 /// <li>
516 /// <p>Spot Instance requests</p></li>
517 /// <li>
518 /// <p>Network interfaces</p></li>
519 /// </ul>
520 /// <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>
521 pub fn get_tag_specifications(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::TagSpecification>> {
522 self.inner.get_tag_specifications()
523 }
524 /// <p>The launch template. Any additional parameters that you specify for the new instance overwrite the corresponding parameters included in the launch template.</p>
525 pub fn launch_template(mut self, input: crate::types::LaunchTemplateSpecification) -> Self {
526 self.inner = self.inner.launch_template(input);
527 self
528 }
529 /// <p>The launch template. Any additional parameters that you specify for the new instance overwrite the corresponding parameters included in the launch template.</p>
530 pub fn set_launch_template(mut self, input: ::std::option::Option<crate::types::LaunchTemplateSpecification>) -> Self {
531 self.inner = self.inner.set_launch_template(input);
532 self
533 }
534 /// <p>The launch template. Any additional parameters that you specify for the new instance overwrite the corresponding parameters included in the launch template.</p>
535 pub fn get_launch_template(&self) -> &::std::option::Option<crate::types::LaunchTemplateSpecification> {
536 self.inner.get_launch_template()
537 }
538 /// <p>The market (purchasing) option for the instances.</p>
539 /// <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>
540 pub fn instance_market_options(mut self, input: crate::types::InstanceMarketOptionsRequest) -> Self {
541 self.inner = self.inner.instance_market_options(input);
542 self
543 }
544 /// <p>The market (purchasing) option for the instances.</p>
545 /// <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>
546 pub fn set_instance_market_options(mut self, input: ::std::option::Option<crate::types::InstanceMarketOptionsRequest>) -> Self {
547 self.inner = self.inner.set_instance_market_options(input);
548 self
549 }
550 /// <p>The market (purchasing) option for the instances.</p>
551 /// <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>
552 pub fn get_instance_market_options(&self) -> &::std::option::Option<crate::types::InstanceMarketOptionsRequest> {
553 self.inner.get_instance_market_options()
554 }
555 /// <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>
556 /// <p>Default: <code>standard</code> (T2 instances) or <code>unlimited</code> (T3/T3a/T4g instances)</p>
557 /// <p>For T3 instances with <code>host</code> tenancy, only <code>standard</code> is supported.</p>
558 pub fn credit_specification(mut self, input: crate::types::CreditSpecificationRequest) -> Self {
559 self.inner = self.inner.credit_specification(input);
560 self
561 }
562 /// <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>
563 /// <p>Default: <code>standard</code> (T2 instances) or <code>unlimited</code> (T3/T3a/T4g instances)</p>
564 /// <p>For T3 instances with <code>host</code> tenancy, only <code>standard</code> is supported.</p>
565 pub fn set_credit_specification(mut self, input: ::std::option::Option<crate::types::CreditSpecificationRequest>) -> Self {
566 self.inner = self.inner.set_credit_specification(input);
567 self
568 }
569 /// <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>
570 /// <p>Default: <code>standard</code> (T2 instances) or <code>unlimited</code> (T3/T3a/T4g instances)</p>
571 /// <p>For T3 instances with <code>host</code> tenancy, only <code>standard</code> is supported.</p>
572 pub fn get_credit_specification(&self) -> &::std::option::Option<crate::types::CreditSpecificationRequest> {
573 self.inner.get_credit_specification()
574 }
575 /// <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>
576 pub fn cpu_options(mut self, input: crate::types::CpuOptionsRequest) -> Self {
577 self.inner = self.inner.cpu_options(input);
578 self
579 }
580 /// <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>
581 pub fn set_cpu_options(mut self, input: ::std::option::Option<crate::types::CpuOptionsRequest>) -> Self {
582 self.inner = self.inner.set_cpu_options(input);
583 self
584 }
585 /// <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>
586 pub fn get_cpu_options(&self) -> &::std::option::Option<crate::types::CpuOptionsRequest> {
587 self.inner.get_cpu_options()
588 }
589 /// <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>
590 pub fn capacity_reservation_specification(mut self, input: crate::types::CapacityReservationSpecification) -> Self {
591 self.inner = self.inner.capacity_reservation_specification(input);
592 self
593 }
594 /// <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>
595 pub fn set_capacity_reservation_specification(mut self, input: ::std::option::Option<crate::types::CapacityReservationSpecification>) -> Self {
596 self.inner = self.inner.set_capacity_reservation_specification(input);
597 self
598 }
599 /// <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>
600 pub fn get_capacity_reservation_specification(&self) -> &::std::option::Option<crate::types::CapacityReservationSpecification> {
601 self.inner.get_capacity_reservation_specification()
602 }
603 /// <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>
604 /// <p>You can't enable hibernation and Amazon Web Services Nitro Enclaves on the same instance.</p>
605 pub fn hibernation_options(mut self, input: crate::types::HibernationOptionsRequest) -> Self {
606 self.inner = self.inner.hibernation_options(input);
607 self
608 }
609 /// <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>
610 /// <p>You can't enable hibernation and Amazon Web Services Nitro Enclaves on the same instance.</p>
611 pub fn set_hibernation_options(mut self, input: ::std::option::Option<crate::types::HibernationOptionsRequest>) -> Self {
612 self.inner = self.inner.set_hibernation_options(input);
613 self
614 }
615 /// <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>
616 /// <p>You can't enable hibernation and Amazon Web Services Nitro Enclaves on the same instance.</p>
617 pub fn get_hibernation_options(&self) -> &::std::option::Option<crate::types::HibernationOptionsRequest> {
618 self.inner.get_hibernation_options()
619 }
620 ///
621 /// Appends an item to `LicenseSpecifications`.
622 ///
623 /// To override the contents of this collection use [`set_license_specifications`](Self::set_license_specifications).
624 ///
625 /// <p>The license configurations.</p>
626 pub fn license_specifications(mut self, input: crate::types::LicenseConfigurationRequest) -> Self {
627 self.inner = self.inner.license_specifications(input);
628 self
629 }
630 /// <p>The license configurations.</p>
631 pub fn set_license_specifications(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::LicenseConfigurationRequest>>) -> Self {
632 self.inner = self.inner.set_license_specifications(input);
633 self
634 }
635 /// <p>The license configurations.</p>
636 pub fn get_license_specifications(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::LicenseConfigurationRequest>> {
637 self.inner.get_license_specifications()
638 }
639 /// <p>The metadata options for the instance. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-metadata.html">Instance metadata and user data</a>.</p>
640 pub fn metadata_options(mut self, input: crate::types::InstanceMetadataOptionsRequest) -> Self {
641 self.inner = self.inner.metadata_options(input);
642 self
643 }
644 /// <p>The metadata options for the instance. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-metadata.html">Instance metadata and user data</a>.</p>
645 pub fn set_metadata_options(mut self, input: ::std::option::Option<crate::types::InstanceMetadataOptionsRequest>) -> Self {
646 self.inner = self.inner.set_metadata_options(input);
647 self
648 }
649 /// <p>The metadata options for the instance. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-metadata.html">Instance metadata and user data</a>.</p>
650 pub fn get_metadata_options(&self) -> &::std::option::Option<crate::types::InstanceMetadataOptionsRequest> {
651 self.inner.get_metadata_options()
652 }
653 /// <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/nitro-enclave.html">What is Amazon Web Services Nitro Enclaves?</a> in the <i>Amazon Web Services Nitro Enclaves User Guide</i>.</p>
654 /// <p>You can't enable Amazon Web Services Nitro Enclaves and hibernation on the same instance.</p>
655 pub fn enclave_options(mut self, input: crate::types::EnclaveOptionsRequest) -> Self {
656 self.inner = self.inner.enclave_options(input);
657 self
658 }
659 /// <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/nitro-enclave.html">What is Amazon Web Services Nitro Enclaves?</a> in the <i>Amazon Web Services Nitro Enclaves User Guide</i>.</p>
660 /// <p>You can't enable Amazon Web Services Nitro Enclaves and hibernation on the same instance.</p>
661 pub fn set_enclave_options(mut self, input: ::std::option::Option<crate::types::EnclaveOptionsRequest>) -> Self {
662 self.inner = self.inner.set_enclave_options(input);
663 self
664 }
665 /// <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/nitro-enclave.html">What is Amazon Web Services Nitro Enclaves?</a> in the <i>Amazon Web Services Nitro Enclaves User Guide</i>.</p>
666 /// <p>You can't enable Amazon Web Services Nitro Enclaves and hibernation on the same instance.</p>
667 pub fn get_enclave_options(&self) -> &::std::option::Option<crate::types::EnclaveOptionsRequest> {
668 self.inner.get_enclave_options()
669 }
670 /// <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>
671 pub fn private_dns_name_options(mut self, input: crate::types::PrivateDnsNameOptionsRequest) -> Self {
672 self.inner = self.inner.private_dns_name_options(input);
673 self
674 }
675 /// <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>
676 pub fn set_private_dns_name_options(mut self, input: ::std::option::Option<crate::types::PrivateDnsNameOptionsRequest>) -> Self {
677 self.inner = self.inner.set_private_dns_name_options(input);
678 self
679 }
680 /// <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>
681 pub fn get_private_dns_name_options(&self) -> &::std::option::Option<crate::types::PrivateDnsNameOptionsRequest> {
682 self.inner.get_private_dns_name_options()
683 }
684 /// <p>The maintenance and recovery options for the instance.</p>
685 pub fn maintenance_options(mut self, input: crate::types::InstanceMaintenanceOptionsRequest) -> Self {
686 self.inner = self.inner.maintenance_options(input);
687 self
688 }
689 /// <p>The maintenance and recovery options for the instance.</p>
690 pub fn set_maintenance_options(mut self, input: ::std::option::Option<crate::types::InstanceMaintenanceOptionsRequest>) -> Self {
691 self.inner = self.inner.set_maintenance_options(input);
692 self
693 }
694 /// <p>The maintenance and recovery options for the instance.</p>
695 pub fn get_maintenance_options(&self) -> &::std::option::Option<crate::types::InstanceMaintenanceOptionsRequest> {
696 self.inner.get_maintenance_options()
697 }
698 /// <p>Indicates whether an instance is enabled for stop protection. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Stop_Start.html#Using_StopProtection">Stop protection</a>.</p>
699 pub fn disable_api_stop(mut self, input: bool) -> Self {
700 self.inner = self.inner.disable_api_stop(input);
701 self
702 }
703 /// <p>Indicates whether an instance is enabled for stop protection. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Stop_Start.html#Using_StopProtection">Stop protection</a>.</p>
704 pub fn set_disable_api_stop(mut self, input: ::std::option::Option<bool>) -> Self {
705 self.inner = self.inner.set_disable_api_stop(input);
706 self
707 }
708 /// <p>Indicates whether an instance is enabled for stop protection. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Stop_Start.html#Using_StopProtection">Stop protection</a>.</p>
709 pub fn get_disable_api_stop(&self) -> &::std::option::Option<bool> {
710 self.inner.get_disable_api_stop()
711 }
712 /// <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>
713 pub fn enable_primary_ipv6(mut self, input: bool) -> Self {
714 self.inner = self.inner.enable_primary_ipv6(input);
715 self
716 }
717 /// <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>
718 pub fn set_enable_primary_ipv6(mut self, input: ::std::option::Option<bool>) -> Self {
719 self.inner = self.inner.set_enable_primary_ipv6(input);
720 self
721 }
722 /// <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>
723 pub fn get_enable_primary_ipv6(&self) -> &::std::option::Option<bool> {
724 self.inner.get_enable_primary_ipv6()
725 }
726 /// <p>Contains settings for the network performance options for the instance.</p>
727 pub fn network_performance_options(mut self, input: crate::types::InstanceNetworkPerformanceOptionsRequest) -> Self {
728 self.inner = self.inner.network_performance_options(input);
729 self
730 }
731 /// <p>Contains settings for the network performance options for the instance.</p>
732 pub fn set_network_performance_options(mut self, input: ::std::option::Option<crate::types::InstanceNetworkPerformanceOptionsRequest>) -> Self {
733 self.inner = self.inner.set_network_performance_options(input);
734 self
735 }
736 /// <p>Contains settings for the network performance options for the instance.</p>
737 pub fn get_network_performance_options(&self) -> &::std::option::Option<crate::types::InstanceNetworkPerformanceOptionsRequest> {
738 self.inner.get_network_performance_options()
739 }
740 /// <p>Reserved for internal use.</p>
741 pub fn operator(mut self, input: crate::types::OperatorRequest) -> Self {
742 self.inner = self.inner.operator(input);
743 self
744 }
745 /// <p>Reserved for internal use.</p>
746 pub fn set_operator(mut self, input: ::std::option::Option<crate::types::OperatorRequest>) -> Self {
747 self.inner = self.inner.set_operator(input);
748 self
749 }
750 /// <p>Reserved for internal use.</p>
751 pub fn get_operator(&self) -> &::std::option::Option<crate::types::OperatorRequest> {
752 self.inner.get_operator()
753 }
754 /// <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>
755 pub fn dry_run(mut self, input: bool) -> Self {
756 self.inner = self.inner.dry_run(input);
757 self
758 }
759 /// <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>
760 pub fn set_dry_run(mut self, input: ::std::option::Option<bool>) -> Self {
761 self.inner = self.inner.set_dry_run(input);
762 self
763 }
764 /// <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>
765 pub fn get_dry_run(&self) -> &::std::option::Option<bool> {
766 self.inner.get_dry_run()
767 }
768 /// <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>
769 pub fn disable_api_termination(mut self, input: bool) -> Self {
770 self.inner = self.inner.disable_api_termination(input);
771 self
772 }
773 /// <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>
774 pub fn set_disable_api_termination(mut self, input: ::std::option::Option<bool>) -> Self {
775 self.inner = self.inner.set_disable_api_termination(input);
776 self
777 }
778 /// <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>
779 pub fn get_disable_api_termination(&self) -> &::std::option::Option<bool> {
780 self.inner.get_disable_api_termination()
781 }
782 /// <p>Indicates whether an instance stops or terminates when you initiate shutdown from the instance (using the operating system command for system shutdown).</p>
783 /// <p>Default: <code>stop</code></p>
784 pub fn instance_initiated_shutdown_behavior(mut self, input: crate::types::ShutdownBehavior) -> Self {
785 self.inner = self.inner.instance_initiated_shutdown_behavior(input);
786 self
787 }
788 /// <p>Indicates whether an instance stops or terminates when you initiate shutdown from the instance (using the operating system command for system shutdown).</p>
789 /// <p>Default: <code>stop</code></p>
790 pub fn set_instance_initiated_shutdown_behavior(mut self, input: ::std::option::Option<crate::types::ShutdownBehavior>) -> Self {
791 self.inner = self.inner.set_instance_initiated_shutdown_behavior(input);
792 self
793 }
794 /// <p>Indicates whether an instance stops or terminates when you initiate shutdown from the instance (using the operating system command for system shutdown).</p>
795 /// <p>Default: <code>stop</code></p>
796 pub fn get_instance_initiated_shutdown_behavior(&self) -> &::std::option::Option<crate::types::ShutdownBehavior> {
797 self.inner.get_instance_initiated_shutdown_behavior()
798 }
799 /// <p>The primary IPv4 address. You must specify a value from the IPv4 address range of the subnet.</p>
800 /// <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>
801 /// <p>You cannot specify this option and the network interfaces option in the same request.</p>
802 pub fn private_ip_address(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
803 self.inner = self.inner.private_ip_address(input.into());
804 self
805 }
806 /// <p>The primary IPv4 address. You must specify a value from the IPv4 address range of the subnet.</p>
807 /// <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>
808 /// <p>You cannot specify this option and the network interfaces option in the same request.</p>
809 pub fn set_private_ip_address(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
810 self.inner = self.inner.set_private_ip_address(input);
811 self
812 }
813 /// <p>The primary IPv4 address. You must specify a value from the IPv4 address range of the subnet.</p>
814 /// <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>
815 /// <p>You cannot specify this option and the network interfaces option in the same request.</p>
816 pub fn get_private_ip_address(&self) -> &::std::option::Option<::std::string::String> {
817 self.inner.get_private_ip_address()
818 }
819 /// <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>
820 /// <p>For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html">Ensuring Idempotency</a>.</p>
821 /// <p>Constraints: Maximum 64 ASCII characters</p>
822 pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
823 self.inner = self.inner.client_token(input.into());
824 self
825 }
826 /// <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>
827 /// <p>For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html">Ensuring Idempotency</a>.</p>
828 /// <p>Constraints: Maximum 64 ASCII characters</p>
829 pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
830 self.inner = self.inner.set_client_token(input);
831 self
832 }
833 /// <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>
834 /// <p>For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html">Ensuring Idempotency</a>.</p>
835 /// <p>Constraints: Maximum 64 ASCII characters</p>
836 pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
837 self.inner.get_client_token()
838 }
839 /// <p>Reserved.</p>
840 pub fn additional_info(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
841 self.inner = self.inner.additional_info(input.into());
842 self
843 }
844 /// <p>Reserved.</p>
845 pub fn set_additional_info(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
846 self.inner = self.inner.set_additional_info(input);
847 self
848 }
849 /// <p>Reserved.</p>
850 pub fn get_additional_info(&self) -> &::std::option::Option<::std::string::String> {
851 self.inner.get_additional_info()
852 }
853 ///
854 /// Appends an item to `NetworkInterfaces`.
855 ///
856 /// To override the contents of this collection use [`set_network_interfaces`](Self::set_network_interfaces).
857 ///
858 /// <p>The network interfaces to associate with the instance.</p>
859 pub fn network_interfaces(mut self, input: crate::types::InstanceNetworkInterfaceSpecification) -> Self {
860 self.inner = self.inner.network_interfaces(input);
861 self
862 }
863 /// <p>The network interfaces to associate with the instance.</p>
864 pub fn set_network_interfaces(
865 mut self,
866 input: ::std::option::Option<::std::vec::Vec<crate::types::InstanceNetworkInterfaceSpecification>>,
867 ) -> Self {
868 self.inner = self.inner.set_network_interfaces(input);
869 self
870 }
871 /// <p>The network interfaces to associate with the instance.</p>
872 pub fn get_network_interfaces(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::InstanceNetworkInterfaceSpecification>> {
873 self.inner.get_network_interfaces()
874 }
875 /// <p>The name or Amazon Resource Name (ARN) of an IAM instance profile.</p>
876 pub fn iam_instance_profile(mut self, input: crate::types::IamInstanceProfileSpecification) -> Self {
877 self.inner = self.inner.iam_instance_profile(input);
878 self
879 }
880 /// <p>The name or Amazon Resource Name (ARN) of an IAM instance profile.</p>
881 pub fn set_iam_instance_profile(mut self, input: ::std::option::Option<crate::types::IamInstanceProfileSpecification>) -> Self {
882 self.inner = self.inner.set_iam_instance_profile(input);
883 self
884 }
885 /// <p>The name or Amazon Resource Name (ARN) of an IAM instance profile.</p>
886 pub fn get_iam_instance_profile(&self) -> &::std::option::Option<crate::types::IamInstanceProfileSpecification> {
887 self.inner.get_iam_instance_profile()
888 }
889 /// <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>
890 /// <p>Default: <code>false</code></p>
891 pub fn ebs_optimized(mut self, input: bool) -> Self {
892 self.inner = self.inner.ebs_optimized(input);
893 self
894 }
895 /// <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>
896 /// <p>Default: <code>false</code></p>
897 pub fn set_ebs_optimized(mut self, input: ::std::option::Option<bool>) -> Self {
898 self.inner = self.inner.set_ebs_optimized(input);
899 self
900 }
901 /// <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>
902 /// <p>Default: <code>false</code></p>
903 pub fn get_ebs_optimized(&self) -> &::std::option::Option<bool> {
904 self.inner.get_ebs_optimized()
905 }
906}