aws_sdk_ec2/operation/run_instances/
_run_instances_input.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2#[allow(missing_docs)] // documentation missing in model
3#[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq)]
5pub struct RunInstancesInput {
6    /// <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>
7    pub block_device_mappings: ::std::option::Option<::std::vec::Vec<crate::types::BlockDeviceMapping>>,
8    /// <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>
9    pub image_id: ::std::option::Option<::std::string::String>,
10    /// <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>
11    pub instance_type: ::std::option::Option<crate::types::InstanceType>,
12    /// <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>
13    /// <p>You cannot specify this option and the network interfaces option in the same request.</p>
14    pub ipv6_address_count: ::std::option::Option<i32>,
15    /// <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>
16    /// <p>You cannot specify this option and the network interfaces option in the same request.</p>
17    pub ipv6_addresses: ::std::option::Option<::std::vec::Vec<crate::types::InstanceIpv6Address>>,
18    /// <p>The ID of the kernel.</p><important>
19    /// <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>
20    /// </important>
21    pub kernel_id: ::std::option::Option<::std::string::String>,
22    /// <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>
23    /// <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>
24    /// </important>
25    pub key_name: ::std::option::Option<::std::string::String>,
26    /// <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>
27    /// <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>
28    pub max_count: ::std::option::Option<i32>,
29    /// <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>
30    /// <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>
31    pub min_count: ::std::option::Option<i32>,
32    /// <p>Specifies whether detailed monitoring is enabled for the instance.</p>
33    pub monitoring: ::std::option::Option<crate::types::RunInstancesMonitoringEnabled>,
34    /// <p>The placement for the instance.</p>
35    pub placement: ::std::option::Option<crate::types::Placement>,
36    /// <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>
37    /// <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>
38    /// </important>
39    pub ramdisk_id: ::std::option::Option<::std::string::String>,
40    /// <p>The IDs of the security groups.</p>
41    /// <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>
42    pub security_group_ids: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
43    /// <p>\[Default VPC\] The names of the security groups.</p>
44    /// <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>
45    /// <p>Default: Amazon EC2 uses the default security group.</p>
46    pub security_groups: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
47    /// <p>The ID of the subnet to launch the instance into.</p>
48    /// <p>If you specify a network interface, you must specify any subnets as part of the network interface instead of using this parameter.</p>
49    pub subnet_id: ::std::option::Option<::std::string::String>,
50    /// <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>
51    pub user_data: ::std::option::Option<::std::string::String>,
52    /// <p>An elastic GPU to associate with the instance.</p><note>
53    /// <p>Amazon Elastic Graphics reached end of life on January 8, 2024.</p>
54    /// </note>
55    #[deprecated(
56        note = "Specifying Elastic Graphics accelerators is no longer supported on the RunInstances API.",
57        since = "2024-01-08"
58    )]
59    pub elastic_gpu_specification: ::std::option::Option<::std::vec::Vec<crate::types::ElasticGpuSpecification>>,
60    /// <p>An elastic inference accelerator to associate with the instance.</p><note>
61    /// <p>Amazon Elastic Inference is no longer available.</p>
62    /// </note>
63    #[deprecated(
64        note = "Specifying Elastic Inference accelerators is no longer supported on the RunInstances API.",
65        since = "2024-01-08"
66    )]
67    pub elastic_inference_accelerators: ::std::option::Option<::std::vec::Vec<crate::types::ElasticInferenceAccelerator>>,
68    /// <p>The tags to apply to the resources that are created during instance launch.</p>
69    /// <p>You can specify tags for the following resources only:</p>
70    /// <ul>
71    /// <li>
72    /// <p>Instances</p></li>
73    /// <li>
74    /// <p>Volumes</p></li>
75    /// <li>
76    /// <p>Spot Instance requests</p></li>
77    /// <li>
78    /// <p>Network interfaces</p></li>
79    /// </ul>
80    /// <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>
81    pub tag_specifications: ::std::option::Option<::std::vec::Vec<crate::types::TagSpecification>>,
82    /// <p>The launch template. Any additional parameters that you specify for the new instance overwrite the corresponding parameters included in the launch template.</p>
83    pub launch_template: ::std::option::Option<crate::types::LaunchTemplateSpecification>,
84    /// <p>The market (purchasing) option for the instances.</p>
85    /// <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>
86    pub instance_market_options: ::std::option::Option<crate::types::InstanceMarketOptionsRequest>,
87    /// <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>
88    /// <p>Default: <code>standard</code> (T2 instances) or <code>unlimited</code> (T3/T3a/T4g instances)</p>
89    /// <p>For T3 instances with <code>host</code> tenancy, only <code>standard</code> is supported.</p>
90    pub credit_specification: ::std::option::Option<crate::types::CreditSpecificationRequest>,
91    /// <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>
92    pub cpu_options: ::std::option::Option<crate::types::CpuOptionsRequest>,
93    /// <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>
94    pub capacity_reservation_specification: ::std::option::Option<crate::types::CapacityReservationSpecification>,
95    /// <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>
96    /// <p>You can't enable hibernation and Amazon Web Services Nitro Enclaves on the same instance.</p>
97    pub hibernation_options: ::std::option::Option<crate::types::HibernationOptionsRequest>,
98    /// <p>The license configurations.</p>
99    pub license_specifications: ::std::option::Option<::std::vec::Vec<crate::types::LicenseConfigurationRequest>>,
100    /// <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>
101    pub metadata_options: ::std::option::Option<crate::types::InstanceMetadataOptionsRequest>,
102    /// <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>
103    /// <p>You can't enable Amazon Web Services Nitro Enclaves and hibernation on the same instance.</p>
104    pub enclave_options: ::std::option::Option<crate::types::EnclaveOptionsRequest>,
105    /// <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>
106    pub private_dns_name_options: ::std::option::Option<crate::types::PrivateDnsNameOptionsRequest>,
107    /// <p>The maintenance and recovery options for the instance.</p>
108    pub maintenance_options: ::std::option::Option<crate::types::InstanceMaintenanceOptionsRequest>,
109    /// <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>
110    pub disable_api_stop: ::std::option::Option<bool>,
111    /// <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>
112    pub enable_primary_ipv6: ::std::option::Option<bool>,
113    /// <p>Contains settings for the network performance options for the instance.</p>
114    pub network_performance_options: ::std::option::Option<crate::types::InstanceNetworkPerformanceOptionsRequest>,
115    /// <p>Reserved for internal use.</p>
116    pub operator: ::std::option::Option<crate::types::OperatorRequest>,
117    /// <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>
118    pub dry_run: ::std::option::Option<bool>,
119    /// <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>
120    pub disable_api_termination: ::std::option::Option<bool>,
121    /// <p>Indicates whether an instance stops or terminates when you initiate shutdown from the instance (using the operating system command for system shutdown).</p>
122    /// <p>Default: <code>stop</code></p>
123    pub instance_initiated_shutdown_behavior: ::std::option::Option<crate::types::ShutdownBehavior>,
124    /// <p>The primary IPv4 address. You must specify a value from the IPv4 address range of the subnet.</p>
125    /// <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>
126    /// <p>You cannot specify this option and the network interfaces option in the same request.</p>
127    pub private_ip_address: ::std::option::Option<::std::string::String>,
128    /// <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>
129    /// <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>
130    /// <p>Constraints: Maximum 64 ASCII characters</p>
131    pub client_token: ::std::option::Option<::std::string::String>,
132    /// <p>Reserved.</p>
133    pub additional_info: ::std::option::Option<::std::string::String>,
134    /// <p>The network interfaces to associate with the instance.</p>
135    pub network_interfaces: ::std::option::Option<::std::vec::Vec<crate::types::InstanceNetworkInterfaceSpecification>>,
136    /// <p>The name or Amazon Resource Name (ARN) of an IAM instance profile.</p>
137    pub iam_instance_profile: ::std::option::Option<crate::types::IamInstanceProfileSpecification>,
138    /// <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>
139    /// <p>Default: <code>false</code></p>
140    pub ebs_optimized: ::std::option::Option<bool>,
141}
142impl RunInstancesInput {
143    /// <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>
144    ///
145    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.block_device_mappings.is_none()`.
146    pub fn block_device_mappings(&self) -> &[crate::types::BlockDeviceMapping] {
147        self.block_device_mappings.as_deref().unwrap_or_default()
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(&self) -> ::std::option::Option<&str> {
151        self.image_id.as_deref()
152    }
153    /// <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>
154    pub fn instance_type(&self) -> ::std::option::Option<&crate::types::InstanceType> {
155        self.instance_type.as_ref()
156    }
157    /// <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>
158    /// <p>You cannot specify this option and the network interfaces option in the same request.</p>
159    pub fn ipv6_address_count(&self) -> ::std::option::Option<i32> {
160        self.ipv6_address_count
161    }
162    /// <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>
163    /// <p>You cannot specify this option and the network interfaces option in the same request.</p>
164    ///
165    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.ipv6_addresses.is_none()`.
166    pub fn ipv6_addresses(&self) -> &[crate::types::InstanceIpv6Address] {
167        self.ipv6_addresses.as_deref().unwrap_or_default()
168    }
169    /// <p>The ID of the kernel.</p><important>
170    /// <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>
171    /// </important>
172    pub fn kernel_id(&self) -> ::std::option::Option<&str> {
173        self.kernel_id.as_deref()
174    }
175    /// <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>
176    /// <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>
177    /// </important>
178    pub fn key_name(&self) -> ::std::option::Option<&str> {
179        self.key_name.as_deref()
180    }
181    /// <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>
182    /// <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>
183    pub fn max_count(&self) -> ::std::option::Option<i32> {
184        self.max_count
185    }
186    /// <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>
187    /// <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>
188    pub fn min_count(&self) -> ::std::option::Option<i32> {
189        self.min_count
190    }
191    /// <p>Specifies whether detailed monitoring is enabled for the instance.</p>
192    pub fn monitoring(&self) -> ::std::option::Option<&crate::types::RunInstancesMonitoringEnabled> {
193        self.monitoring.as_ref()
194    }
195    /// <p>The placement for the instance.</p>
196    pub fn placement(&self) -> ::std::option::Option<&crate::types::Placement> {
197        self.placement.as_ref()
198    }
199    /// <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>
200    /// <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>
201    /// </important>
202    pub fn ramdisk_id(&self) -> ::std::option::Option<&str> {
203        self.ramdisk_id.as_deref()
204    }
205    /// <p>The IDs of the security groups.</p>
206    /// <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>
207    ///
208    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.security_group_ids.is_none()`.
209    pub fn security_group_ids(&self) -> &[::std::string::String] {
210        self.security_group_ids.as_deref().unwrap_or_default()
211    }
212    /// <p>\[Default VPC\] The names of the security groups.</p>
213    /// <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>
214    /// <p>Default: Amazon EC2 uses the default security group.</p>
215    ///
216    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.security_groups.is_none()`.
217    pub fn security_groups(&self) -> &[::std::string::String] {
218        self.security_groups.as_deref().unwrap_or_default()
219    }
220    /// <p>The ID of the subnet to launch the instance into.</p>
221    /// <p>If you specify a network interface, you must specify any subnets as part of the network interface instead of using this parameter.</p>
222    pub fn subnet_id(&self) -> ::std::option::Option<&str> {
223        self.subnet_id.as_deref()
224    }
225    /// <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>
226    pub fn user_data(&self) -> ::std::option::Option<&str> {
227        self.user_data.as_deref()
228    }
229    /// <p>An elastic GPU to associate with the instance.</p><note>
230    /// <p>Amazon Elastic Graphics reached end of life on January 8, 2024.</p>
231    /// </note>
232    ///
233    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.elastic_gpu_specification.is_none()`.
234    #[deprecated(
235        note = "Specifying Elastic Graphics accelerators is no longer supported on the RunInstances API.",
236        since = "2024-01-08"
237    )]
238    pub fn elastic_gpu_specification(&self) -> &[crate::types::ElasticGpuSpecification] {
239        self.elastic_gpu_specification.as_deref().unwrap_or_default()
240    }
241    /// <p>An elastic inference accelerator to associate with the instance.</p><note>
242    /// <p>Amazon Elastic Inference is no longer available.</p>
243    /// </note>
244    ///
245    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.elastic_inference_accelerators.is_none()`.
246    #[deprecated(
247        note = "Specifying Elastic Inference accelerators is no longer supported on the RunInstances API.",
248        since = "2024-01-08"
249    )]
250    pub fn elastic_inference_accelerators(&self) -> &[crate::types::ElasticInferenceAccelerator] {
251        self.elastic_inference_accelerators.as_deref().unwrap_or_default()
252    }
253    /// <p>The tags to apply to the resources that are created during instance launch.</p>
254    /// <p>You can specify tags for the following resources only:</p>
255    /// <ul>
256    /// <li>
257    /// <p>Instances</p></li>
258    /// <li>
259    /// <p>Volumes</p></li>
260    /// <li>
261    /// <p>Spot Instance requests</p></li>
262    /// <li>
263    /// <p>Network interfaces</p></li>
264    /// </ul>
265    /// <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>
266    ///
267    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.tag_specifications.is_none()`.
268    pub fn tag_specifications(&self) -> &[crate::types::TagSpecification] {
269        self.tag_specifications.as_deref().unwrap_or_default()
270    }
271    /// <p>The launch template. Any additional parameters that you specify for the new instance overwrite the corresponding parameters included in the launch template.</p>
272    pub fn launch_template(&self) -> ::std::option::Option<&crate::types::LaunchTemplateSpecification> {
273        self.launch_template.as_ref()
274    }
275    /// <p>The market (purchasing) option for the instances.</p>
276    /// <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>
277    pub fn instance_market_options(&self) -> ::std::option::Option<&crate::types::InstanceMarketOptionsRequest> {
278        self.instance_market_options.as_ref()
279    }
280    /// <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>
281    /// <p>Default: <code>standard</code> (T2 instances) or <code>unlimited</code> (T3/T3a/T4g instances)</p>
282    /// <p>For T3 instances with <code>host</code> tenancy, only <code>standard</code> is supported.</p>
283    pub fn credit_specification(&self) -> ::std::option::Option<&crate::types::CreditSpecificationRequest> {
284        self.credit_specification.as_ref()
285    }
286    /// <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>
287    pub fn cpu_options(&self) -> ::std::option::Option<&crate::types::CpuOptionsRequest> {
288        self.cpu_options.as_ref()
289    }
290    /// <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>
291    pub fn capacity_reservation_specification(&self) -> ::std::option::Option<&crate::types::CapacityReservationSpecification> {
292        self.capacity_reservation_specification.as_ref()
293    }
294    /// <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>
295    /// <p>You can't enable hibernation and Amazon Web Services Nitro Enclaves on the same instance.</p>
296    pub fn hibernation_options(&self) -> ::std::option::Option<&crate::types::HibernationOptionsRequest> {
297        self.hibernation_options.as_ref()
298    }
299    /// <p>The license configurations.</p>
300    ///
301    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.license_specifications.is_none()`.
302    pub fn license_specifications(&self) -> &[crate::types::LicenseConfigurationRequest] {
303        self.license_specifications.as_deref().unwrap_or_default()
304    }
305    /// <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>
306    pub fn metadata_options(&self) -> ::std::option::Option<&crate::types::InstanceMetadataOptionsRequest> {
307        self.metadata_options.as_ref()
308    }
309    /// <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>
310    /// <p>You can't enable Amazon Web Services Nitro Enclaves and hibernation on the same instance.</p>
311    pub fn enclave_options(&self) -> ::std::option::Option<&crate::types::EnclaveOptionsRequest> {
312        self.enclave_options.as_ref()
313    }
314    /// <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>
315    pub fn private_dns_name_options(&self) -> ::std::option::Option<&crate::types::PrivateDnsNameOptionsRequest> {
316        self.private_dns_name_options.as_ref()
317    }
318    /// <p>The maintenance and recovery options for the instance.</p>
319    pub fn maintenance_options(&self) -> ::std::option::Option<&crate::types::InstanceMaintenanceOptionsRequest> {
320        self.maintenance_options.as_ref()
321    }
322    /// <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>
323    pub fn disable_api_stop(&self) -> ::std::option::Option<bool> {
324        self.disable_api_stop
325    }
326    /// <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>
327    pub fn enable_primary_ipv6(&self) -> ::std::option::Option<bool> {
328        self.enable_primary_ipv6
329    }
330    /// <p>Contains settings for the network performance options for the instance.</p>
331    pub fn network_performance_options(&self) -> ::std::option::Option<&crate::types::InstanceNetworkPerformanceOptionsRequest> {
332        self.network_performance_options.as_ref()
333    }
334    /// <p>Reserved for internal use.</p>
335    pub fn operator(&self) -> ::std::option::Option<&crate::types::OperatorRequest> {
336        self.operator.as_ref()
337    }
338    /// <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>
339    pub fn dry_run(&self) -> ::std::option::Option<bool> {
340        self.dry_run
341    }
342    /// <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>
343    pub fn disable_api_termination(&self) -> ::std::option::Option<bool> {
344        self.disable_api_termination
345    }
346    /// <p>Indicates whether an instance stops or terminates when you initiate shutdown from the instance (using the operating system command for system shutdown).</p>
347    /// <p>Default: <code>stop</code></p>
348    pub fn instance_initiated_shutdown_behavior(&self) -> ::std::option::Option<&crate::types::ShutdownBehavior> {
349        self.instance_initiated_shutdown_behavior.as_ref()
350    }
351    /// <p>The primary IPv4 address. You must specify a value from the IPv4 address range of the subnet.</p>
352    /// <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>
353    /// <p>You cannot specify this option and the network interfaces option in the same request.</p>
354    pub fn private_ip_address(&self) -> ::std::option::Option<&str> {
355        self.private_ip_address.as_deref()
356    }
357    /// <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>
358    /// <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>
359    /// <p>Constraints: Maximum 64 ASCII characters</p>
360    pub fn client_token(&self) -> ::std::option::Option<&str> {
361        self.client_token.as_deref()
362    }
363    /// <p>Reserved.</p>
364    pub fn additional_info(&self) -> ::std::option::Option<&str> {
365        self.additional_info.as_deref()
366    }
367    /// <p>The network interfaces to associate with the instance.</p>
368    ///
369    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.network_interfaces.is_none()`.
370    pub fn network_interfaces(&self) -> &[crate::types::InstanceNetworkInterfaceSpecification] {
371        self.network_interfaces.as_deref().unwrap_or_default()
372    }
373    /// <p>The name or Amazon Resource Name (ARN) of an IAM instance profile.</p>
374    pub fn iam_instance_profile(&self) -> ::std::option::Option<&crate::types::IamInstanceProfileSpecification> {
375        self.iam_instance_profile.as_ref()
376    }
377    /// <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>
378    /// <p>Default: <code>false</code></p>
379    pub fn ebs_optimized(&self) -> ::std::option::Option<bool> {
380        self.ebs_optimized
381    }
382}
383impl ::std::fmt::Debug for RunInstancesInput {
384    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
385        let mut formatter = f.debug_struct("RunInstancesInput");
386        formatter.field("block_device_mappings", &self.block_device_mappings);
387        formatter.field("image_id", &self.image_id);
388        formatter.field("instance_type", &self.instance_type);
389        formatter.field("ipv6_address_count", &self.ipv6_address_count);
390        formatter.field("ipv6_addresses", &self.ipv6_addresses);
391        formatter.field("kernel_id", &self.kernel_id);
392        formatter.field("key_name", &self.key_name);
393        formatter.field("max_count", &self.max_count);
394        formatter.field("min_count", &self.min_count);
395        formatter.field("monitoring", &self.monitoring);
396        formatter.field("placement", &self.placement);
397        formatter.field("ramdisk_id", &self.ramdisk_id);
398        formatter.field("security_group_ids", &self.security_group_ids);
399        formatter.field("security_groups", &self.security_groups);
400        formatter.field("subnet_id", &self.subnet_id);
401        formatter.field("user_data", &"*** Sensitive Data Redacted ***");
402        formatter.field("elastic_gpu_specification", &self.elastic_gpu_specification);
403        formatter.field("elastic_inference_accelerators", &self.elastic_inference_accelerators);
404        formatter.field("tag_specifications", &self.tag_specifications);
405        formatter.field("launch_template", &self.launch_template);
406        formatter.field("instance_market_options", &self.instance_market_options);
407        formatter.field("credit_specification", &self.credit_specification);
408        formatter.field("cpu_options", &self.cpu_options);
409        formatter.field("capacity_reservation_specification", &self.capacity_reservation_specification);
410        formatter.field("hibernation_options", &self.hibernation_options);
411        formatter.field("license_specifications", &self.license_specifications);
412        formatter.field("metadata_options", &self.metadata_options);
413        formatter.field("enclave_options", &self.enclave_options);
414        formatter.field("private_dns_name_options", &self.private_dns_name_options);
415        formatter.field("maintenance_options", &self.maintenance_options);
416        formatter.field("disable_api_stop", &self.disable_api_stop);
417        formatter.field("enable_primary_ipv6", &self.enable_primary_ipv6);
418        formatter.field("network_performance_options", &self.network_performance_options);
419        formatter.field("operator", &self.operator);
420        formatter.field("dry_run", &self.dry_run);
421        formatter.field("disable_api_termination", &self.disable_api_termination);
422        formatter.field("instance_initiated_shutdown_behavior", &self.instance_initiated_shutdown_behavior);
423        formatter.field("private_ip_address", &self.private_ip_address);
424        formatter.field("client_token", &self.client_token);
425        formatter.field("additional_info", &self.additional_info);
426        formatter.field("network_interfaces", &self.network_interfaces);
427        formatter.field("iam_instance_profile", &self.iam_instance_profile);
428        formatter.field("ebs_optimized", &self.ebs_optimized);
429        formatter.finish()
430    }
431}
432impl RunInstancesInput {
433    /// Creates a new builder-style object to manufacture [`RunInstancesInput`](crate::operation::run_instances::RunInstancesInput).
434    pub fn builder() -> crate::operation::run_instances::builders::RunInstancesInputBuilder {
435        crate::operation::run_instances::builders::RunInstancesInputBuilder::default()
436    }
437}
438
439/// A builder for [`RunInstancesInput`](crate::operation::run_instances::RunInstancesInput).
440#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)]
441#[non_exhaustive]
442pub struct RunInstancesInputBuilder {
443    pub(crate) block_device_mappings: ::std::option::Option<::std::vec::Vec<crate::types::BlockDeviceMapping>>,
444    pub(crate) image_id: ::std::option::Option<::std::string::String>,
445    pub(crate) instance_type: ::std::option::Option<crate::types::InstanceType>,
446    pub(crate) ipv6_address_count: ::std::option::Option<i32>,
447    pub(crate) ipv6_addresses: ::std::option::Option<::std::vec::Vec<crate::types::InstanceIpv6Address>>,
448    pub(crate) kernel_id: ::std::option::Option<::std::string::String>,
449    pub(crate) key_name: ::std::option::Option<::std::string::String>,
450    pub(crate) max_count: ::std::option::Option<i32>,
451    pub(crate) min_count: ::std::option::Option<i32>,
452    pub(crate) monitoring: ::std::option::Option<crate::types::RunInstancesMonitoringEnabled>,
453    pub(crate) placement: ::std::option::Option<crate::types::Placement>,
454    pub(crate) ramdisk_id: ::std::option::Option<::std::string::String>,
455    pub(crate) security_group_ids: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
456    pub(crate) security_groups: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
457    pub(crate) subnet_id: ::std::option::Option<::std::string::String>,
458    pub(crate) user_data: ::std::option::Option<::std::string::String>,
459    pub(crate) elastic_gpu_specification: ::std::option::Option<::std::vec::Vec<crate::types::ElasticGpuSpecification>>,
460    pub(crate) elastic_inference_accelerators: ::std::option::Option<::std::vec::Vec<crate::types::ElasticInferenceAccelerator>>,
461    pub(crate) tag_specifications: ::std::option::Option<::std::vec::Vec<crate::types::TagSpecification>>,
462    pub(crate) launch_template: ::std::option::Option<crate::types::LaunchTemplateSpecification>,
463    pub(crate) instance_market_options: ::std::option::Option<crate::types::InstanceMarketOptionsRequest>,
464    pub(crate) credit_specification: ::std::option::Option<crate::types::CreditSpecificationRequest>,
465    pub(crate) cpu_options: ::std::option::Option<crate::types::CpuOptionsRequest>,
466    pub(crate) capacity_reservation_specification: ::std::option::Option<crate::types::CapacityReservationSpecification>,
467    pub(crate) hibernation_options: ::std::option::Option<crate::types::HibernationOptionsRequest>,
468    pub(crate) license_specifications: ::std::option::Option<::std::vec::Vec<crate::types::LicenseConfigurationRequest>>,
469    pub(crate) metadata_options: ::std::option::Option<crate::types::InstanceMetadataOptionsRequest>,
470    pub(crate) enclave_options: ::std::option::Option<crate::types::EnclaveOptionsRequest>,
471    pub(crate) private_dns_name_options: ::std::option::Option<crate::types::PrivateDnsNameOptionsRequest>,
472    pub(crate) maintenance_options: ::std::option::Option<crate::types::InstanceMaintenanceOptionsRequest>,
473    pub(crate) disable_api_stop: ::std::option::Option<bool>,
474    pub(crate) enable_primary_ipv6: ::std::option::Option<bool>,
475    pub(crate) network_performance_options: ::std::option::Option<crate::types::InstanceNetworkPerformanceOptionsRequest>,
476    pub(crate) operator: ::std::option::Option<crate::types::OperatorRequest>,
477    pub(crate) dry_run: ::std::option::Option<bool>,
478    pub(crate) disable_api_termination: ::std::option::Option<bool>,
479    pub(crate) instance_initiated_shutdown_behavior: ::std::option::Option<crate::types::ShutdownBehavior>,
480    pub(crate) private_ip_address: ::std::option::Option<::std::string::String>,
481    pub(crate) client_token: ::std::option::Option<::std::string::String>,
482    pub(crate) additional_info: ::std::option::Option<::std::string::String>,
483    pub(crate) network_interfaces: ::std::option::Option<::std::vec::Vec<crate::types::InstanceNetworkInterfaceSpecification>>,
484    pub(crate) iam_instance_profile: ::std::option::Option<crate::types::IamInstanceProfileSpecification>,
485    pub(crate) ebs_optimized: ::std::option::Option<bool>,
486}
487impl RunInstancesInputBuilder {
488    /// Appends an item to `block_device_mappings`.
489    ///
490    /// To override the contents of this collection use [`set_block_device_mappings`](Self::set_block_device_mappings).
491    ///
492    /// <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>
493    pub fn block_device_mappings(mut self, input: crate::types::BlockDeviceMapping) -> Self {
494        let mut v = self.block_device_mappings.unwrap_or_default();
495        v.push(input);
496        self.block_device_mappings = ::std::option::Option::Some(v);
497        self
498    }
499    /// <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>
500    pub fn set_block_device_mappings(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::BlockDeviceMapping>>) -> Self {
501        self.block_device_mappings = input;
502        self
503    }
504    /// <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>
505    pub fn get_block_device_mappings(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::BlockDeviceMapping>> {
506        &self.block_device_mappings
507    }
508    /// <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>
509    pub fn image_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
510        self.image_id = ::std::option::Option::Some(input.into());
511        self
512    }
513    /// <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>
514    pub fn set_image_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
515        self.image_id = input;
516        self
517    }
518    /// <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>
519    pub fn get_image_id(&self) -> &::std::option::Option<::std::string::String> {
520        &self.image_id
521    }
522    /// <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>
523    pub fn instance_type(mut self, input: crate::types::InstanceType) -> Self {
524        self.instance_type = ::std::option::Option::Some(input);
525        self
526    }
527    /// <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>
528    pub fn set_instance_type(mut self, input: ::std::option::Option<crate::types::InstanceType>) -> Self {
529        self.instance_type = input;
530        self
531    }
532    /// <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>
533    pub fn get_instance_type(&self) -> &::std::option::Option<crate::types::InstanceType> {
534        &self.instance_type
535    }
536    /// <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>
537    /// <p>You cannot specify this option and the network interfaces option in the same request.</p>
538    pub fn ipv6_address_count(mut self, input: i32) -> Self {
539        self.ipv6_address_count = ::std::option::Option::Some(input);
540        self
541    }
542    /// <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>
543    /// <p>You cannot specify this option and the network interfaces option in the same request.</p>
544    pub fn set_ipv6_address_count(mut self, input: ::std::option::Option<i32>) -> Self {
545        self.ipv6_address_count = input;
546        self
547    }
548    /// <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>
549    /// <p>You cannot specify this option and the network interfaces option in the same request.</p>
550    pub fn get_ipv6_address_count(&self) -> &::std::option::Option<i32> {
551        &self.ipv6_address_count
552    }
553    /// Appends an item to `ipv6_addresses`.
554    ///
555    /// To override the contents of this collection use [`set_ipv6_addresses`](Self::set_ipv6_addresses).
556    ///
557    /// <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>
558    /// <p>You cannot specify this option and the network interfaces option in the same request.</p>
559    pub fn ipv6_addresses(mut self, input: crate::types::InstanceIpv6Address) -> Self {
560        let mut v = self.ipv6_addresses.unwrap_or_default();
561        v.push(input);
562        self.ipv6_addresses = ::std::option::Option::Some(v);
563        self
564    }
565    /// <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>
566    /// <p>You cannot specify this option and the network interfaces option in the same request.</p>
567    pub fn set_ipv6_addresses(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::InstanceIpv6Address>>) -> Self {
568        self.ipv6_addresses = input;
569        self
570    }
571    /// <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>
572    /// <p>You cannot specify this option and the network interfaces option in the same request.</p>
573    pub fn get_ipv6_addresses(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::InstanceIpv6Address>> {
574        &self.ipv6_addresses
575    }
576    /// <p>The ID of the kernel.</p><important>
577    /// <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>
578    /// </important>
579    pub fn kernel_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
580        self.kernel_id = ::std::option::Option::Some(input.into());
581        self
582    }
583    /// <p>The ID of the kernel.</p><important>
584    /// <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>
585    /// </important>
586    pub fn set_kernel_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
587        self.kernel_id = input;
588        self
589    }
590    /// <p>The ID of the kernel.</p><important>
591    /// <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>
592    /// </important>
593    pub fn get_kernel_id(&self) -> &::std::option::Option<::std::string::String> {
594        &self.kernel_id
595    }
596    /// <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>
597    /// <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>
598    /// </important>
599    pub fn key_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
600        self.key_name = ::std::option::Option::Some(input.into());
601        self
602    }
603    /// <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>
604    /// <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>
605    /// </important>
606    pub fn set_key_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
607        self.key_name = input;
608        self
609    }
610    /// <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>
611    /// <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>
612    /// </important>
613    pub fn get_key_name(&self) -> &::std::option::Option<::std::string::String> {
614        &self.key_name
615    }
616    /// <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>
617    /// <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>
618    /// This field is required.
619    pub fn max_count(mut self, input: i32) -> Self {
620        self.max_count = ::std::option::Option::Some(input);
621        self
622    }
623    /// <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>
624    /// <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>
625    pub fn set_max_count(mut self, input: ::std::option::Option<i32>) -> Self {
626        self.max_count = input;
627        self
628    }
629    /// <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>
630    /// <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>
631    pub fn get_max_count(&self) -> &::std::option::Option<i32> {
632        &self.max_count
633    }
634    /// <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>
635    /// <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>
636    /// This field is required.
637    pub fn min_count(mut self, input: i32) -> Self {
638        self.min_count = ::std::option::Option::Some(input);
639        self
640    }
641    /// <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>
642    /// <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>
643    pub fn set_min_count(mut self, input: ::std::option::Option<i32>) -> Self {
644        self.min_count = input;
645        self
646    }
647    /// <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>
648    /// <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>
649    pub fn get_min_count(&self) -> &::std::option::Option<i32> {
650        &self.min_count
651    }
652    /// <p>Specifies whether detailed monitoring is enabled for the instance.</p>
653    pub fn monitoring(mut self, input: crate::types::RunInstancesMonitoringEnabled) -> Self {
654        self.monitoring = ::std::option::Option::Some(input);
655        self
656    }
657    /// <p>Specifies whether detailed monitoring is enabled for the instance.</p>
658    pub fn set_monitoring(mut self, input: ::std::option::Option<crate::types::RunInstancesMonitoringEnabled>) -> Self {
659        self.monitoring = input;
660        self
661    }
662    /// <p>Specifies whether detailed monitoring is enabled for the instance.</p>
663    pub fn get_monitoring(&self) -> &::std::option::Option<crate::types::RunInstancesMonitoringEnabled> {
664        &self.monitoring
665    }
666    /// <p>The placement for the instance.</p>
667    pub fn placement(mut self, input: crate::types::Placement) -> Self {
668        self.placement = ::std::option::Option::Some(input);
669        self
670    }
671    /// <p>The placement for the instance.</p>
672    pub fn set_placement(mut self, input: ::std::option::Option<crate::types::Placement>) -> Self {
673        self.placement = input;
674        self
675    }
676    /// <p>The placement for the instance.</p>
677    pub fn get_placement(&self) -> &::std::option::Option<crate::types::Placement> {
678        &self.placement
679    }
680    /// <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>
681    /// <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>
682    /// </important>
683    pub fn ramdisk_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
684        self.ramdisk_id = ::std::option::Option::Some(input.into());
685        self
686    }
687    /// <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>
688    /// <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>
689    /// </important>
690    pub fn set_ramdisk_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
691        self.ramdisk_id = input;
692        self
693    }
694    /// <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>
695    /// <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>
696    /// </important>
697    pub fn get_ramdisk_id(&self) -> &::std::option::Option<::std::string::String> {
698        &self.ramdisk_id
699    }
700    /// Appends an item to `security_group_ids`.
701    ///
702    /// To override the contents of this collection use [`set_security_group_ids`](Self::set_security_group_ids).
703    ///
704    /// <p>The IDs of the security groups.</p>
705    /// <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>
706    pub fn security_group_ids(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
707        let mut v = self.security_group_ids.unwrap_or_default();
708        v.push(input.into());
709        self.security_group_ids = ::std::option::Option::Some(v);
710        self
711    }
712    /// <p>The IDs of the security groups.</p>
713    /// <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>
714    pub fn set_security_group_ids(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
715        self.security_group_ids = input;
716        self
717    }
718    /// <p>The IDs of the security groups.</p>
719    /// <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>
720    pub fn get_security_group_ids(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
721        &self.security_group_ids
722    }
723    /// Appends an item to `security_groups`.
724    ///
725    /// To override the contents of this collection use [`set_security_groups`](Self::set_security_groups).
726    ///
727    /// <p>\[Default VPC\] The names of the security groups.</p>
728    /// <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>
729    /// <p>Default: Amazon EC2 uses the default security group.</p>
730    pub fn security_groups(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
731        let mut v = self.security_groups.unwrap_or_default();
732        v.push(input.into());
733        self.security_groups = ::std::option::Option::Some(v);
734        self
735    }
736    /// <p>\[Default VPC\] The names of the security groups.</p>
737    /// <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>
738    /// <p>Default: Amazon EC2 uses the default security group.</p>
739    pub fn set_security_groups(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
740        self.security_groups = input;
741        self
742    }
743    /// <p>\[Default VPC\] The names of the security groups.</p>
744    /// <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>
745    /// <p>Default: Amazon EC2 uses the default security group.</p>
746    pub fn get_security_groups(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
747        &self.security_groups
748    }
749    /// <p>The ID of the subnet to launch the instance into.</p>
750    /// <p>If you specify a network interface, you must specify any subnets as part of the network interface instead of using this parameter.</p>
751    pub fn subnet_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
752        self.subnet_id = ::std::option::Option::Some(input.into());
753        self
754    }
755    /// <p>The ID of the subnet to launch the instance into.</p>
756    /// <p>If you specify a network interface, you must specify any subnets as part of the network interface instead of using this parameter.</p>
757    pub fn set_subnet_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
758        self.subnet_id = input;
759        self
760    }
761    /// <p>The ID of the subnet to launch the instance into.</p>
762    /// <p>If you specify a network interface, you must specify any subnets as part of the network interface instead of using this parameter.</p>
763    pub fn get_subnet_id(&self) -> &::std::option::Option<::std::string::String> {
764        &self.subnet_id
765    }
766    /// <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>
767    pub fn user_data(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
768        self.user_data = ::std::option::Option::Some(input.into());
769        self
770    }
771    /// <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>
772    pub fn set_user_data(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
773        self.user_data = input;
774        self
775    }
776    /// <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>
777    pub fn get_user_data(&self) -> &::std::option::Option<::std::string::String> {
778        &self.user_data
779    }
780    /// Appends an item to `elastic_gpu_specification`.
781    ///
782    /// To override the contents of this collection use [`set_elastic_gpu_specification`](Self::set_elastic_gpu_specification).
783    ///
784    /// <p>An elastic GPU to associate with the instance.</p><note>
785    /// <p>Amazon Elastic Graphics reached end of life on January 8, 2024.</p>
786    /// </note>
787    #[deprecated(
788        note = "Specifying Elastic Graphics accelerators is no longer supported on the RunInstances API.",
789        since = "2024-01-08"
790    )]
791    pub fn elastic_gpu_specification(mut self, input: crate::types::ElasticGpuSpecification) -> Self {
792        let mut v = self.elastic_gpu_specification.unwrap_or_default();
793        v.push(input);
794        self.elastic_gpu_specification = ::std::option::Option::Some(v);
795        self
796    }
797    /// <p>An elastic GPU to associate with the instance.</p><note>
798    /// <p>Amazon Elastic Graphics reached end of life on January 8, 2024.</p>
799    /// </note>
800    #[deprecated(
801        note = "Specifying Elastic Graphics accelerators is no longer supported on the RunInstances API.",
802        since = "2024-01-08"
803    )]
804    pub fn set_elastic_gpu_specification(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::ElasticGpuSpecification>>) -> Self {
805        self.elastic_gpu_specification = input;
806        self
807    }
808    /// <p>An elastic GPU to associate with the instance.</p><note>
809    /// <p>Amazon Elastic Graphics reached end of life on January 8, 2024.</p>
810    /// </note>
811    #[deprecated(
812        note = "Specifying Elastic Graphics accelerators is no longer supported on the RunInstances API.",
813        since = "2024-01-08"
814    )]
815    pub fn get_elastic_gpu_specification(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::ElasticGpuSpecification>> {
816        &self.elastic_gpu_specification
817    }
818    /// Appends an item to `elastic_inference_accelerators`.
819    ///
820    /// To override the contents of this collection use [`set_elastic_inference_accelerators`](Self::set_elastic_inference_accelerators).
821    ///
822    /// <p>An elastic inference accelerator to associate with the instance.</p><note>
823    /// <p>Amazon Elastic Inference is no longer available.</p>
824    /// </note>
825    #[deprecated(
826        note = "Specifying Elastic Inference accelerators is no longer supported on the RunInstances API.",
827        since = "2024-01-08"
828    )]
829    pub fn elastic_inference_accelerators(mut self, input: crate::types::ElasticInferenceAccelerator) -> Self {
830        let mut v = self.elastic_inference_accelerators.unwrap_or_default();
831        v.push(input);
832        self.elastic_inference_accelerators = ::std::option::Option::Some(v);
833        self
834    }
835    /// <p>An elastic inference accelerator to associate with the instance.</p><note>
836    /// <p>Amazon Elastic Inference is no longer available.</p>
837    /// </note>
838    #[deprecated(
839        note = "Specifying Elastic Inference accelerators is no longer supported on the RunInstances API.",
840        since = "2024-01-08"
841    )]
842    pub fn set_elastic_inference_accelerators(
843        mut self,
844        input: ::std::option::Option<::std::vec::Vec<crate::types::ElasticInferenceAccelerator>>,
845    ) -> Self {
846        self.elastic_inference_accelerators = input;
847        self
848    }
849    /// <p>An elastic inference accelerator to associate with the instance.</p><note>
850    /// <p>Amazon Elastic Inference is no longer available.</p>
851    /// </note>
852    #[deprecated(
853        note = "Specifying Elastic Inference accelerators is no longer supported on the RunInstances API.",
854        since = "2024-01-08"
855    )]
856    pub fn get_elastic_inference_accelerators(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::ElasticInferenceAccelerator>> {
857        &self.elastic_inference_accelerators
858    }
859    /// Appends an item to `tag_specifications`.
860    ///
861    /// To override the contents of this collection use [`set_tag_specifications`](Self::set_tag_specifications).
862    ///
863    /// <p>The tags to apply to the resources that are created during instance launch.</p>
864    /// <p>You can specify tags for the following resources only:</p>
865    /// <ul>
866    /// <li>
867    /// <p>Instances</p></li>
868    /// <li>
869    /// <p>Volumes</p></li>
870    /// <li>
871    /// <p>Spot Instance requests</p></li>
872    /// <li>
873    /// <p>Network interfaces</p></li>
874    /// </ul>
875    /// <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>
876    pub fn tag_specifications(mut self, input: crate::types::TagSpecification) -> Self {
877        let mut v = self.tag_specifications.unwrap_or_default();
878        v.push(input);
879        self.tag_specifications = ::std::option::Option::Some(v);
880        self
881    }
882    /// <p>The tags to apply to the resources that are created during instance launch.</p>
883    /// <p>You can specify tags for the following resources only:</p>
884    /// <ul>
885    /// <li>
886    /// <p>Instances</p></li>
887    /// <li>
888    /// <p>Volumes</p></li>
889    /// <li>
890    /// <p>Spot Instance requests</p></li>
891    /// <li>
892    /// <p>Network interfaces</p></li>
893    /// </ul>
894    /// <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>
895    pub fn set_tag_specifications(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::TagSpecification>>) -> Self {
896        self.tag_specifications = input;
897        self
898    }
899    /// <p>The tags to apply to the resources that are created during instance launch.</p>
900    /// <p>You can specify tags for the following resources only:</p>
901    /// <ul>
902    /// <li>
903    /// <p>Instances</p></li>
904    /// <li>
905    /// <p>Volumes</p></li>
906    /// <li>
907    /// <p>Spot Instance requests</p></li>
908    /// <li>
909    /// <p>Network interfaces</p></li>
910    /// </ul>
911    /// <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>
912    pub fn get_tag_specifications(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::TagSpecification>> {
913        &self.tag_specifications
914    }
915    /// <p>The launch template. Any additional parameters that you specify for the new instance overwrite the corresponding parameters included in the launch template.</p>
916    pub fn launch_template(mut self, input: crate::types::LaunchTemplateSpecification) -> Self {
917        self.launch_template = ::std::option::Option::Some(input);
918        self
919    }
920    /// <p>The launch template. Any additional parameters that you specify for the new instance overwrite the corresponding parameters included in the launch template.</p>
921    pub fn set_launch_template(mut self, input: ::std::option::Option<crate::types::LaunchTemplateSpecification>) -> Self {
922        self.launch_template = input;
923        self
924    }
925    /// <p>The launch template. Any additional parameters that you specify for the new instance overwrite the corresponding parameters included in the launch template.</p>
926    pub fn get_launch_template(&self) -> &::std::option::Option<crate::types::LaunchTemplateSpecification> {
927        &self.launch_template
928    }
929    /// <p>The market (purchasing) option for the instances.</p>
930    /// <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>
931    pub fn instance_market_options(mut self, input: crate::types::InstanceMarketOptionsRequest) -> Self {
932        self.instance_market_options = ::std::option::Option::Some(input);
933        self
934    }
935    /// <p>The market (purchasing) option for the instances.</p>
936    /// <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>
937    pub fn set_instance_market_options(mut self, input: ::std::option::Option<crate::types::InstanceMarketOptionsRequest>) -> Self {
938        self.instance_market_options = input;
939        self
940    }
941    /// <p>The market (purchasing) option for the instances.</p>
942    /// <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>
943    pub fn get_instance_market_options(&self) -> &::std::option::Option<crate::types::InstanceMarketOptionsRequest> {
944        &self.instance_market_options
945    }
946    /// <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>
947    /// <p>Default: <code>standard</code> (T2 instances) or <code>unlimited</code> (T3/T3a/T4g instances)</p>
948    /// <p>For T3 instances with <code>host</code> tenancy, only <code>standard</code> is supported.</p>
949    pub fn credit_specification(mut self, input: crate::types::CreditSpecificationRequest) -> Self {
950        self.credit_specification = ::std::option::Option::Some(input);
951        self
952    }
953    /// <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>
954    /// <p>Default: <code>standard</code> (T2 instances) or <code>unlimited</code> (T3/T3a/T4g instances)</p>
955    /// <p>For T3 instances with <code>host</code> tenancy, only <code>standard</code> is supported.</p>
956    pub fn set_credit_specification(mut self, input: ::std::option::Option<crate::types::CreditSpecificationRequest>) -> Self {
957        self.credit_specification = input;
958        self
959    }
960    /// <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>
961    /// <p>Default: <code>standard</code> (T2 instances) or <code>unlimited</code> (T3/T3a/T4g instances)</p>
962    /// <p>For T3 instances with <code>host</code> tenancy, only <code>standard</code> is supported.</p>
963    pub fn get_credit_specification(&self) -> &::std::option::Option<crate::types::CreditSpecificationRequest> {
964        &self.credit_specification
965    }
966    /// <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>
967    pub fn cpu_options(mut self, input: crate::types::CpuOptionsRequest) -> Self {
968        self.cpu_options = ::std::option::Option::Some(input);
969        self
970    }
971    /// <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>
972    pub fn set_cpu_options(mut self, input: ::std::option::Option<crate::types::CpuOptionsRequest>) -> Self {
973        self.cpu_options = input;
974        self
975    }
976    /// <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>
977    pub fn get_cpu_options(&self) -> &::std::option::Option<crate::types::CpuOptionsRequest> {
978        &self.cpu_options
979    }
980    /// <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>
981    pub fn capacity_reservation_specification(mut self, input: crate::types::CapacityReservationSpecification) -> Self {
982        self.capacity_reservation_specification = ::std::option::Option::Some(input);
983        self
984    }
985    /// <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>
986    pub fn set_capacity_reservation_specification(mut self, input: ::std::option::Option<crate::types::CapacityReservationSpecification>) -> Self {
987        self.capacity_reservation_specification = input;
988        self
989    }
990    /// <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>
991    pub fn get_capacity_reservation_specification(&self) -> &::std::option::Option<crate::types::CapacityReservationSpecification> {
992        &self.capacity_reservation_specification
993    }
994    /// <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>
995    /// <p>You can't enable hibernation and Amazon Web Services Nitro Enclaves on the same instance.</p>
996    pub fn hibernation_options(mut self, input: crate::types::HibernationOptionsRequest) -> Self {
997        self.hibernation_options = ::std::option::Option::Some(input);
998        self
999    }
1000    /// <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>
1001    /// <p>You can't enable hibernation and Amazon Web Services Nitro Enclaves on the same instance.</p>
1002    pub fn set_hibernation_options(mut self, input: ::std::option::Option<crate::types::HibernationOptionsRequest>) -> Self {
1003        self.hibernation_options = input;
1004        self
1005    }
1006    /// <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>
1007    /// <p>You can't enable hibernation and Amazon Web Services Nitro Enclaves on the same instance.</p>
1008    pub fn get_hibernation_options(&self) -> &::std::option::Option<crate::types::HibernationOptionsRequest> {
1009        &self.hibernation_options
1010    }
1011    /// Appends an item to `license_specifications`.
1012    ///
1013    /// To override the contents of this collection use [`set_license_specifications`](Self::set_license_specifications).
1014    ///
1015    /// <p>The license configurations.</p>
1016    pub fn license_specifications(mut self, input: crate::types::LicenseConfigurationRequest) -> Self {
1017        let mut v = self.license_specifications.unwrap_or_default();
1018        v.push(input);
1019        self.license_specifications = ::std::option::Option::Some(v);
1020        self
1021    }
1022    /// <p>The license configurations.</p>
1023    pub fn set_license_specifications(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::LicenseConfigurationRequest>>) -> Self {
1024        self.license_specifications = input;
1025        self
1026    }
1027    /// <p>The license configurations.</p>
1028    pub fn get_license_specifications(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::LicenseConfigurationRequest>> {
1029        &self.license_specifications
1030    }
1031    /// <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>
1032    pub fn metadata_options(mut self, input: crate::types::InstanceMetadataOptionsRequest) -> Self {
1033        self.metadata_options = ::std::option::Option::Some(input);
1034        self
1035    }
1036    /// <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>
1037    pub fn set_metadata_options(mut self, input: ::std::option::Option<crate::types::InstanceMetadataOptionsRequest>) -> Self {
1038        self.metadata_options = input;
1039        self
1040    }
1041    /// <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>
1042    pub fn get_metadata_options(&self) -> &::std::option::Option<crate::types::InstanceMetadataOptionsRequest> {
1043        &self.metadata_options
1044    }
1045    /// <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>
1046    /// <p>You can't enable Amazon Web Services Nitro Enclaves and hibernation on the same instance.</p>
1047    pub fn enclave_options(mut self, input: crate::types::EnclaveOptionsRequest) -> Self {
1048        self.enclave_options = ::std::option::Option::Some(input);
1049        self
1050    }
1051    /// <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>
1052    /// <p>You can't enable Amazon Web Services Nitro Enclaves and hibernation on the same instance.</p>
1053    pub fn set_enclave_options(mut self, input: ::std::option::Option<crate::types::EnclaveOptionsRequest>) -> Self {
1054        self.enclave_options = input;
1055        self
1056    }
1057    /// <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>
1058    /// <p>You can't enable Amazon Web Services Nitro Enclaves and hibernation on the same instance.</p>
1059    pub fn get_enclave_options(&self) -> &::std::option::Option<crate::types::EnclaveOptionsRequest> {
1060        &self.enclave_options
1061    }
1062    /// <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>
1063    pub fn private_dns_name_options(mut self, input: crate::types::PrivateDnsNameOptionsRequest) -> Self {
1064        self.private_dns_name_options = ::std::option::Option::Some(input);
1065        self
1066    }
1067    /// <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>
1068    pub fn set_private_dns_name_options(mut self, input: ::std::option::Option<crate::types::PrivateDnsNameOptionsRequest>) -> Self {
1069        self.private_dns_name_options = input;
1070        self
1071    }
1072    /// <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>
1073    pub fn get_private_dns_name_options(&self) -> &::std::option::Option<crate::types::PrivateDnsNameOptionsRequest> {
1074        &self.private_dns_name_options
1075    }
1076    /// <p>The maintenance and recovery options for the instance.</p>
1077    pub fn maintenance_options(mut self, input: crate::types::InstanceMaintenanceOptionsRequest) -> Self {
1078        self.maintenance_options = ::std::option::Option::Some(input);
1079        self
1080    }
1081    /// <p>The maintenance and recovery options for the instance.</p>
1082    pub fn set_maintenance_options(mut self, input: ::std::option::Option<crate::types::InstanceMaintenanceOptionsRequest>) -> Self {
1083        self.maintenance_options = input;
1084        self
1085    }
1086    /// <p>The maintenance and recovery options for the instance.</p>
1087    pub fn get_maintenance_options(&self) -> &::std::option::Option<crate::types::InstanceMaintenanceOptionsRequest> {
1088        &self.maintenance_options
1089    }
1090    /// <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>
1091    pub fn disable_api_stop(mut self, input: bool) -> Self {
1092        self.disable_api_stop = ::std::option::Option::Some(input);
1093        self
1094    }
1095    /// <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>
1096    pub fn set_disable_api_stop(mut self, input: ::std::option::Option<bool>) -> Self {
1097        self.disable_api_stop = input;
1098        self
1099    }
1100    /// <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>
1101    pub fn get_disable_api_stop(&self) -> &::std::option::Option<bool> {
1102        &self.disable_api_stop
1103    }
1104    /// <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>
1105    pub fn enable_primary_ipv6(mut self, input: bool) -> Self {
1106        self.enable_primary_ipv6 = ::std::option::Option::Some(input);
1107        self
1108    }
1109    /// <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>
1110    pub fn set_enable_primary_ipv6(mut self, input: ::std::option::Option<bool>) -> Self {
1111        self.enable_primary_ipv6 = input;
1112        self
1113    }
1114    /// <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>
1115    pub fn get_enable_primary_ipv6(&self) -> &::std::option::Option<bool> {
1116        &self.enable_primary_ipv6
1117    }
1118    /// <p>Contains settings for the network performance options for the instance.</p>
1119    pub fn network_performance_options(mut self, input: crate::types::InstanceNetworkPerformanceOptionsRequest) -> Self {
1120        self.network_performance_options = ::std::option::Option::Some(input);
1121        self
1122    }
1123    /// <p>Contains settings for the network performance options for the instance.</p>
1124    pub fn set_network_performance_options(mut self, input: ::std::option::Option<crate::types::InstanceNetworkPerformanceOptionsRequest>) -> Self {
1125        self.network_performance_options = input;
1126        self
1127    }
1128    /// <p>Contains settings for the network performance options for the instance.</p>
1129    pub fn get_network_performance_options(&self) -> &::std::option::Option<crate::types::InstanceNetworkPerformanceOptionsRequest> {
1130        &self.network_performance_options
1131    }
1132    /// <p>Reserved for internal use.</p>
1133    pub fn operator(mut self, input: crate::types::OperatorRequest) -> Self {
1134        self.operator = ::std::option::Option::Some(input);
1135        self
1136    }
1137    /// <p>Reserved for internal use.</p>
1138    pub fn set_operator(mut self, input: ::std::option::Option<crate::types::OperatorRequest>) -> Self {
1139        self.operator = input;
1140        self
1141    }
1142    /// <p>Reserved for internal use.</p>
1143    pub fn get_operator(&self) -> &::std::option::Option<crate::types::OperatorRequest> {
1144        &self.operator
1145    }
1146    /// <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>
1147    pub fn dry_run(mut self, input: bool) -> Self {
1148        self.dry_run = ::std::option::Option::Some(input);
1149        self
1150    }
1151    /// <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>
1152    pub fn set_dry_run(mut self, input: ::std::option::Option<bool>) -> Self {
1153        self.dry_run = input;
1154        self
1155    }
1156    /// <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>
1157    pub fn get_dry_run(&self) -> &::std::option::Option<bool> {
1158        &self.dry_run
1159    }
1160    /// <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>
1161    pub fn disable_api_termination(mut self, input: bool) -> Self {
1162        self.disable_api_termination = ::std::option::Option::Some(input);
1163        self
1164    }
1165    /// <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>
1166    pub fn set_disable_api_termination(mut self, input: ::std::option::Option<bool>) -> Self {
1167        self.disable_api_termination = input;
1168        self
1169    }
1170    /// <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>
1171    pub fn get_disable_api_termination(&self) -> &::std::option::Option<bool> {
1172        &self.disable_api_termination
1173    }
1174    /// <p>Indicates whether an instance stops or terminates when you initiate shutdown from the instance (using the operating system command for system shutdown).</p>
1175    /// <p>Default: <code>stop</code></p>
1176    pub fn instance_initiated_shutdown_behavior(mut self, input: crate::types::ShutdownBehavior) -> Self {
1177        self.instance_initiated_shutdown_behavior = ::std::option::Option::Some(input);
1178        self
1179    }
1180    /// <p>Indicates whether an instance stops or terminates when you initiate shutdown from the instance (using the operating system command for system shutdown).</p>
1181    /// <p>Default: <code>stop</code></p>
1182    pub fn set_instance_initiated_shutdown_behavior(mut self, input: ::std::option::Option<crate::types::ShutdownBehavior>) -> Self {
1183        self.instance_initiated_shutdown_behavior = input;
1184        self
1185    }
1186    /// <p>Indicates whether an instance stops or terminates when you initiate shutdown from the instance (using the operating system command for system shutdown).</p>
1187    /// <p>Default: <code>stop</code></p>
1188    pub fn get_instance_initiated_shutdown_behavior(&self) -> &::std::option::Option<crate::types::ShutdownBehavior> {
1189        &self.instance_initiated_shutdown_behavior
1190    }
1191    /// <p>The primary IPv4 address. You must specify a value from the IPv4 address range of the subnet.</p>
1192    /// <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>
1193    /// <p>You cannot specify this option and the network interfaces option in the same request.</p>
1194    pub fn private_ip_address(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
1195        self.private_ip_address = ::std::option::Option::Some(input.into());
1196        self
1197    }
1198    /// <p>The primary IPv4 address. You must specify a value from the IPv4 address range of the subnet.</p>
1199    /// <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>
1200    /// <p>You cannot specify this option and the network interfaces option in the same request.</p>
1201    pub fn set_private_ip_address(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
1202        self.private_ip_address = input;
1203        self
1204    }
1205    /// <p>The primary IPv4 address. You must specify a value from the IPv4 address range of the subnet.</p>
1206    /// <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>
1207    /// <p>You cannot specify this option and the network interfaces option in the same request.</p>
1208    pub fn get_private_ip_address(&self) -> &::std::option::Option<::std::string::String> {
1209        &self.private_ip_address
1210    }
1211    /// <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>
1212    /// <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>
1213    /// <p>Constraints: Maximum 64 ASCII characters</p>
1214    pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
1215        self.client_token = ::std::option::Option::Some(input.into());
1216        self
1217    }
1218    /// <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>
1219    /// <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>
1220    /// <p>Constraints: Maximum 64 ASCII characters</p>
1221    pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
1222        self.client_token = input;
1223        self
1224    }
1225    /// <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>
1226    /// <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>
1227    /// <p>Constraints: Maximum 64 ASCII characters</p>
1228    pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
1229        &self.client_token
1230    }
1231    /// <p>Reserved.</p>
1232    pub fn additional_info(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
1233        self.additional_info = ::std::option::Option::Some(input.into());
1234        self
1235    }
1236    /// <p>Reserved.</p>
1237    pub fn set_additional_info(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
1238        self.additional_info = input;
1239        self
1240    }
1241    /// <p>Reserved.</p>
1242    pub fn get_additional_info(&self) -> &::std::option::Option<::std::string::String> {
1243        &self.additional_info
1244    }
1245    /// Appends an item to `network_interfaces`.
1246    ///
1247    /// To override the contents of this collection use [`set_network_interfaces`](Self::set_network_interfaces).
1248    ///
1249    /// <p>The network interfaces to associate with the instance.</p>
1250    pub fn network_interfaces(mut self, input: crate::types::InstanceNetworkInterfaceSpecification) -> Self {
1251        let mut v = self.network_interfaces.unwrap_or_default();
1252        v.push(input);
1253        self.network_interfaces = ::std::option::Option::Some(v);
1254        self
1255    }
1256    /// <p>The network interfaces to associate with the instance.</p>
1257    pub fn set_network_interfaces(
1258        mut self,
1259        input: ::std::option::Option<::std::vec::Vec<crate::types::InstanceNetworkInterfaceSpecification>>,
1260    ) -> Self {
1261        self.network_interfaces = input;
1262        self
1263    }
1264    /// <p>The network interfaces to associate with the instance.</p>
1265    pub fn get_network_interfaces(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::InstanceNetworkInterfaceSpecification>> {
1266        &self.network_interfaces
1267    }
1268    /// <p>The name or Amazon Resource Name (ARN) of an IAM instance profile.</p>
1269    pub fn iam_instance_profile(mut self, input: crate::types::IamInstanceProfileSpecification) -> Self {
1270        self.iam_instance_profile = ::std::option::Option::Some(input);
1271        self
1272    }
1273    /// <p>The name or Amazon Resource Name (ARN) of an IAM instance profile.</p>
1274    pub fn set_iam_instance_profile(mut self, input: ::std::option::Option<crate::types::IamInstanceProfileSpecification>) -> Self {
1275        self.iam_instance_profile = input;
1276        self
1277    }
1278    /// <p>The name or Amazon Resource Name (ARN) of an IAM instance profile.</p>
1279    pub fn get_iam_instance_profile(&self) -> &::std::option::Option<crate::types::IamInstanceProfileSpecification> {
1280        &self.iam_instance_profile
1281    }
1282    /// <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>
1283    /// <p>Default: <code>false</code></p>
1284    pub fn ebs_optimized(mut self, input: bool) -> Self {
1285        self.ebs_optimized = ::std::option::Option::Some(input);
1286        self
1287    }
1288    /// <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>
1289    /// <p>Default: <code>false</code></p>
1290    pub fn set_ebs_optimized(mut self, input: ::std::option::Option<bool>) -> Self {
1291        self.ebs_optimized = input;
1292        self
1293    }
1294    /// <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>
1295    /// <p>Default: <code>false</code></p>
1296    pub fn get_ebs_optimized(&self) -> &::std::option::Option<bool> {
1297        &self.ebs_optimized
1298    }
1299    /// Consumes the builder and constructs a [`RunInstancesInput`](crate::operation::run_instances::RunInstancesInput).
1300    pub fn build(
1301        self,
1302    ) -> ::std::result::Result<crate::operation::run_instances::RunInstancesInput, ::aws_smithy_types::error::operation::BuildError> {
1303        ::std::result::Result::Ok(crate::operation::run_instances::RunInstancesInput {
1304            block_device_mappings: self.block_device_mappings,
1305            image_id: self.image_id,
1306            instance_type: self.instance_type,
1307            ipv6_address_count: self.ipv6_address_count,
1308            ipv6_addresses: self.ipv6_addresses,
1309            kernel_id: self.kernel_id,
1310            key_name: self.key_name,
1311            max_count: self.max_count,
1312            min_count: self.min_count,
1313            monitoring: self.monitoring,
1314            placement: self.placement,
1315            ramdisk_id: self.ramdisk_id,
1316            security_group_ids: self.security_group_ids,
1317            security_groups: self.security_groups,
1318            subnet_id: self.subnet_id,
1319            user_data: self.user_data,
1320            elastic_gpu_specification: self.elastic_gpu_specification,
1321            elastic_inference_accelerators: self.elastic_inference_accelerators,
1322            tag_specifications: self.tag_specifications,
1323            launch_template: self.launch_template,
1324            instance_market_options: self.instance_market_options,
1325            credit_specification: self.credit_specification,
1326            cpu_options: self.cpu_options,
1327            capacity_reservation_specification: self.capacity_reservation_specification,
1328            hibernation_options: self.hibernation_options,
1329            license_specifications: self.license_specifications,
1330            metadata_options: self.metadata_options,
1331            enclave_options: self.enclave_options,
1332            private_dns_name_options: self.private_dns_name_options,
1333            maintenance_options: self.maintenance_options,
1334            disable_api_stop: self.disable_api_stop,
1335            enable_primary_ipv6: self.enable_primary_ipv6,
1336            network_performance_options: self.network_performance_options,
1337            operator: self.operator,
1338            dry_run: self.dry_run,
1339            disable_api_termination: self.disable_api_termination,
1340            instance_initiated_shutdown_behavior: self.instance_initiated_shutdown_behavior,
1341            private_ip_address: self.private_ip_address,
1342            client_token: self.client_token,
1343            additional_info: self.additional_info,
1344            network_interfaces: self.network_interfaces,
1345            iam_instance_profile: self.iam_instance_profile,
1346            ebs_optimized: self.ebs_optimized,
1347        })
1348    }
1349}
1350impl ::std::fmt::Debug for RunInstancesInputBuilder {
1351    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
1352        let mut formatter = f.debug_struct("RunInstancesInputBuilder");
1353        formatter.field("block_device_mappings", &self.block_device_mappings);
1354        formatter.field("image_id", &self.image_id);
1355        formatter.field("instance_type", &self.instance_type);
1356        formatter.field("ipv6_address_count", &self.ipv6_address_count);
1357        formatter.field("ipv6_addresses", &self.ipv6_addresses);
1358        formatter.field("kernel_id", &self.kernel_id);
1359        formatter.field("key_name", &self.key_name);
1360        formatter.field("max_count", &self.max_count);
1361        formatter.field("min_count", &self.min_count);
1362        formatter.field("monitoring", &self.monitoring);
1363        formatter.field("placement", &self.placement);
1364        formatter.field("ramdisk_id", &self.ramdisk_id);
1365        formatter.field("security_group_ids", &self.security_group_ids);
1366        formatter.field("security_groups", &self.security_groups);
1367        formatter.field("subnet_id", &self.subnet_id);
1368        formatter.field("user_data", &"*** Sensitive Data Redacted ***");
1369        formatter.field("elastic_gpu_specification", &self.elastic_gpu_specification);
1370        formatter.field("elastic_inference_accelerators", &self.elastic_inference_accelerators);
1371        formatter.field("tag_specifications", &self.tag_specifications);
1372        formatter.field("launch_template", &self.launch_template);
1373        formatter.field("instance_market_options", &self.instance_market_options);
1374        formatter.field("credit_specification", &self.credit_specification);
1375        formatter.field("cpu_options", &self.cpu_options);
1376        formatter.field("capacity_reservation_specification", &self.capacity_reservation_specification);
1377        formatter.field("hibernation_options", &self.hibernation_options);
1378        formatter.field("license_specifications", &self.license_specifications);
1379        formatter.field("metadata_options", &self.metadata_options);
1380        formatter.field("enclave_options", &self.enclave_options);
1381        formatter.field("private_dns_name_options", &self.private_dns_name_options);
1382        formatter.field("maintenance_options", &self.maintenance_options);
1383        formatter.field("disable_api_stop", &self.disable_api_stop);
1384        formatter.field("enable_primary_ipv6", &self.enable_primary_ipv6);
1385        formatter.field("network_performance_options", &self.network_performance_options);
1386        formatter.field("operator", &self.operator);
1387        formatter.field("dry_run", &self.dry_run);
1388        formatter.field("disable_api_termination", &self.disable_api_termination);
1389        formatter.field("instance_initiated_shutdown_behavior", &self.instance_initiated_shutdown_behavior);
1390        formatter.field("private_ip_address", &self.private_ip_address);
1391        formatter.field("client_token", &self.client_token);
1392        formatter.field("additional_info", &self.additional_info);
1393        formatter.field("network_interfaces", &self.network_interfaces);
1394        formatter.field("iam_instance_profile", &self.iam_instance_profile);
1395        formatter.field("ebs_optimized", &self.ebs_optimized);
1396        formatter.finish()
1397    }
1398}