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