// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
pub use crate::operation::run_instances::_run_instances_input::RunInstancesInputBuilder;
pub use crate::operation::run_instances::_run_instances_output::RunInstancesOutputBuilder;
impl crate::operation::run_instances::builders::RunInstancesInputBuilder {
/// Sends a request with this input using the given client.
pub async fn send_with(
self,
client: &crate::Client,
) -> ::std::result::Result<
crate::operation::run_instances::RunInstancesOutput,
::aws_smithy_runtime_api::client::result::SdkError<
crate::operation::run_instances::RunInstancesError,
::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
>,
> {
let mut fluent_builder = client.run_instances();
fluent_builder.inner = self;
fluent_builder.send().await
}
}
/// Fluent builder constructing a request to `RunInstances`.
///
/// <p>Launches the specified number of instances using an AMI for which you have permissions.</p>
/// <p>You can specify a number of options, or leave the default options. The following rules apply:</p>
/// <ul>
/// <li>
/// <p>If you don't specify a subnet ID, we choose a default subnet from your default VPC for you. If you don't have a default VPC, you must specify a subnet ID in the request.</p></li>
/// <li>
/// <p>All instances have a network interface with a primary private IPv4 address. If you don't specify this address, we choose one from the IPv4 range of your subnet.</p></li>
/// <li>
/// <p>Not all instance types support IPv6 addresses. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-types.html">Instance types</a>.</p></li>
/// <li>
/// <p>If you don't specify a security group ID, we use the default security group for the VPC. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-network-security.html">Security groups</a>.</p></li>
/// <li>
/// <p>If any of the AMIs have a product code attached for which the user has not subscribed, the request fails.</p></li>
/// </ul>
/// <p>You can create a <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-launch-templates.html">launch template</a>, which is a resource that contains the parameters to launch an instance. When you launch an instance using <code>RunInstances</code>, you can specify the launch template instead of specifying the launch parameters.</p>
/// <p>To ensure faster instance launches, break up large requests into smaller batches. For example, create five separate launch requests for 100 instances each instead of one launch request for 500 instances.</p>
/// <p><code>RunInstances</code> is subject to both request rate limiting and resource rate limiting. For more information, see <a href="https://docs.aws.amazon.com/ec2/latest/devguide/ec2-api-throttling.html">Request throttling</a>.</p>
/// <p>An instance is ready for you to use when it's in the <code>running</code> state. You can check the state of your instance using <code>DescribeInstances</code>. You can tag instances and EBS volumes during launch, after launch, or both. For more information, see <code>CreateTags</code> and <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Using_Tags.html">Tagging your Amazon EC2 resources</a>.</p>
/// <p>Linux instances have access to the public key of the key pair at boot. You can use this key to provide secure access to the instance. Amazon EC2 public images use this feature to provide secure access without passwords. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-key-pairs.html">Key pairs</a>.</p>
/// <p>For troubleshooting, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Using_InstanceStraightToTerminated.html">What to do if an instance immediately terminates</a>, and <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/TroubleshootingInstancesConnecting.html">Troubleshooting connecting to your instance</a>.</p>
#[derive(::std::clone::Clone, ::std::fmt::Debug)]
pub struct RunInstancesFluentBuilder {
handle: ::std::sync::Arc<crate::client::Handle>,
inner: crate::operation::run_instances::builders::RunInstancesInputBuilder,
config_override: ::std::option::Option<crate::config::Builder>,
}
impl
crate::client::customize::internal::CustomizableSend<
crate::operation::run_instances::RunInstancesOutput,
crate::operation::run_instances::RunInstancesError,
> for RunInstancesFluentBuilder
{
fn send(
self,
config_override: crate::config::Builder,
) -> crate::client::customize::internal::BoxFuture<
crate::client::customize::internal::SendResult<
crate::operation::run_instances::RunInstancesOutput,
crate::operation::run_instances::RunInstancesError,
>,
> {
::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
}
}
impl RunInstancesFluentBuilder {
/// Creates a new `RunInstancesFluentBuilder`.
pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
Self {
handle,
inner: ::std::default::Default::default(),
config_override: ::std::option::Option::None,
}
}
/// Access the RunInstances as a reference.
pub fn as_input(&self) -> &crate::operation::run_instances::builders::RunInstancesInputBuilder {
&self.inner
}
/// Sends the request and returns the response.
///
/// If an error occurs, an `SdkError` will be returned with additional details that
/// can be matched against.
///
/// By default, any retryable failures will be retried twice. Retry behavior
/// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
/// set when configuring the client.
pub async fn send(
self,
) -> ::std::result::Result<
crate::operation::run_instances::RunInstancesOutput,
::aws_smithy_runtime_api::client::result::SdkError<
crate::operation::run_instances::RunInstancesError,
::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
>,
> {
let input = self
.inner
.build()
.map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
let runtime_plugins = crate::operation::run_instances::RunInstances::operation_runtime_plugins(
self.handle.runtime_plugins.clone(),
&self.handle.conf,
self.config_override,
);
crate::operation::run_instances::RunInstances::orchestrate(&runtime_plugins, input).await
}
/// Consumes this builder, creating a customizable operation that can be modified before being sent.
pub fn customize(
self,
) -> crate::client::customize::CustomizableOperation<
crate::operation::run_instances::RunInstancesOutput,
crate::operation::run_instances::RunInstancesError,
Self,
> {
crate::client::customize::CustomizableOperation::new(self)
}
pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
self.set_config_override(::std::option::Option::Some(config_override.into()));
self
}
pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
self.config_override = config_override;
self
}
///
/// Appends an item to `BlockDeviceMappings`.
///
/// To override the contents of this collection use [`set_block_device_mappings`](Self::set_block_device_mappings).
///
/// <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>
pub fn block_device_mappings(mut self, input: crate::types::BlockDeviceMapping) -> Self {
self.inner = self.inner.block_device_mappings(input);
self
}
/// <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>
pub fn set_block_device_mappings(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::BlockDeviceMapping>>) -> Self {
self.inner = self.inner.set_block_device_mappings(input);
self
}
/// <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>
pub fn get_block_device_mappings(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::BlockDeviceMapping>> {
self.inner.get_block_device_mappings()
}
/// <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>
pub fn image_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.inner = self.inner.image_id(input.into());
self
}
/// <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>
pub fn set_image_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.inner = self.inner.set_image_id(input);
self
}
/// <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>
pub fn get_image_id(&self) -> &::std::option::Option<::std::string::String> {
self.inner.get_image_id()
}
/// <p>The instance type. For more information, see <a href="https://docs.aws.amazon.com/ec2/latest/instancetypes/instance-types.html">Amazon EC2 Instance Types Guide</a>.</p>
pub fn instance_type(mut self, input: crate::types::InstanceType) -> Self {
self.inner = self.inner.instance_type(input);
self
}
/// <p>The instance type. For more information, see <a href="https://docs.aws.amazon.com/ec2/latest/instancetypes/instance-types.html">Amazon EC2 Instance Types Guide</a>.</p>
pub fn set_instance_type(mut self, input: ::std::option::Option<crate::types::InstanceType>) -> Self {
self.inner = self.inner.set_instance_type(input);
self
}
/// <p>The instance type. For more information, see <a href="https://docs.aws.amazon.com/ec2/latest/instancetypes/instance-types.html">Amazon EC2 Instance Types Guide</a>.</p>
pub fn get_instance_type(&self) -> &::std::option::Option<crate::types::InstanceType> {
self.inner.get_instance_type()
}
/// <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>
/// <p>You cannot specify this option and the network interfaces option in the same request.</p>
pub fn ipv6_address_count(mut self, input: i32) -> Self {
self.inner = self.inner.ipv6_address_count(input);
self
}
/// <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>
/// <p>You cannot specify this option and the network interfaces option in the same request.</p>
pub fn set_ipv6_address_count(mut self, input: ::std::option::Option<i32>) -> Self {
self.inner = self.inner.set_ipv6_address_count(input);
self
}
/// <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>
/// <p>You cannot specify this option and the network interfaces option in the same request.</p>
pub fn get_ipv6_address_count(&self) -> &::std::option::Option<i32> {
self.inner.get_ipv6_address_count()
}
///
/// Appends an item to `Ipv6Addresses`.
///
/// To override the contents of this collection use [`set_ipv6_addresses`](Self::set_ipv6_addresses).
///
/// <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>
/// <p>You cannot specify this option and the network interfaces option in the same request.</p>
pub fn ipv6_addresses(mut self, input: crate::types::InstanceIpv6Address) -> Self {
self.inner = self.inner.ipv6_addresses(input);
self
}
/// <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>
/// <p>You cannot specify this option and the network interfaces option in the same request.</p>
pub fn set_ipv6_addresses(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::InstanceIpv6Address>>) -> Self {
self.inner = self.inner.set_ipv6_addresses(input);
self
}
/// <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>
/// <p>You cannot specify this option and the network interfaces option in the same request.</p>
pub fn get_ipv6_addresses(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::InstanceIpv6Address>> {
self.inner.get_ipv6_addresses()
}
/// <p>The ID of the kernel.</p><important>
/// <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>
/// </important>
pub fn kernel_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.inner = self.inner.kernel_id(input.into());
self
}
/// <p>The ID of the kernel.</p><important>
/// <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>
/// </important>
pub fn set_kernel_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.inner = self.inner.set_kernel_id(input);
self
}
/// <p>The ID of the kernel.</p><important>
/// <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>
/// </important>
pub fn get_kernel_id(&self) -> &::std::option::Option<::std::string::String> {
self.inner.get_kernel_id()
}
/// <p>The name of the key pair. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/create-key-pairs.html">Create a key pair for your EC2 instance</a>.</p><important>
/// <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>
/// </important>
pub fn key_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.inner = self.inner.key_name(input.into());
self
}
/// <p>The name of the key pair. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/create-key-pairs.html">Create a key pair for your EC2 instance</a>.</p><important>
/// <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>
/// </important>
pub fn set_key_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.inner = self.inner.set_key_name(input);
self
}
/// <p>The name of the key pair. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/create-key-pairs.html">Create a key pair for your EC2 instance</a>.</p><important>
/// <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>
/// </important>
pub fn get_key_name(&self) -> &::std::option::Option<::std::string::String> {
self.inner.get_key_name()
}
/// <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>
/// <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>
pub fn max_count(mut self, input: i32) -> Self {
self.inner = self.inner.max_count(input);
self
}
/// <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>
/// <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>
pub fn set_max_count(mut self, input: ::std::option::Option<i32>) -> Self {
self.inner = self.inner.set_max_count(input);
self
}
/// <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>
/// <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>
pub fn get_max_count(&self) -> &::std::option::Option<i32> {
self.inner.get_max_count()
}
/// <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>
/// <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>
pub fn min_count(mut self, input: i32) -> Self {
self.inner = self.inner.min_count(input);
self
}
/// <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>
/// <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>
pub fn set_min_count(mut self, input: ::std::option::Option<i32>) -> Self {
self.inner = self.inner.set_min_count(input);
self
}
/// <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>
/// <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>
pub fn get_min_count(&self) -> &::std::option::Option<i32> {
self.inner.get_min_count()
}
/// <p>Specifies whether detailed monitoring is enabled for the instance.</p>
pub fn monitoring(mut self, input: crate::types::RunInstancesMonitoringEnabled) -> Self {
self.inner = self.inner.monitoring(input);
self
}
/// <p>Specifies whether detailed monitoring is enabled for the instance.</p>
pub fn set_monitoring(mut self, input: ::std::option::Option<crate::types::RunInstancesMonitoringEnabled>) -> Self {
self.inner = self.inner.set_monitoring(input);
self
}
/// <p>Specifies whether detailed monitoring is enabled for the instance.</p>
pub fn get_monitoring(&self) -> &::std::option::Option<crate::types::RunInstancesMonitoringEnabled> {
self.inner.get_monitoring()
}
/// <p>The placement for the instance.</p>
pub fn placement(mut self, input: crate::types::Placement) -> Self {
self.inner = self.inner.placement(input);
self
}
/// <p>The placement for the instance.</p>
pub fn set_placement(mut self, input: ::std::option::Option<crate::types::Placement>) -> Self {
self.inner = self.inner.set_placement(input);
self
}
/// <p>The placement for the instance.</p>
pub fn get_placement(&self) -> &::std::option::Option<crate::types::Placement> {
self.inner.get_placement()
}
/// <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>
/// <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>
/// </important>
pub fn ramdisk_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.inner = self.inner.ramdisk_id(input.into());
self
}
/// <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>
/// <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>
/// </important>
pub fn set_ramdisk_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.inner = self.inner.set_ramdisk_id(input);
self
}
/// <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>
/// <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>
/// </important>
pub fn get_ramdisk_id(&self) -> &::std::option::Option<::std::string::String> {
self.inner.get_ramdisk_id()
}
///
/// Appends an item to `SecurityGroupIds`.
///
/// To override the contents of this collection use [`set_security_group_ids`](Self::set_security_group_ids).
///
/// <p>The IDs of the security groups.</p>
/// <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>
pub fn security_group_ids(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.inner = self.inner.security_group_ids(input.into());
self
}
/// <p>The IDs of the security groups.</p>
/// <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>
pub fn set_security_group_ids(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
self.inner = self.inner.set_security_group_ids(input);
self
}
/// <p>The IDs of the security groups.</p>
/// <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>
pub fn get_security_group_ids(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
self.inner.get_security_group_ids()
}
///
/// Appends an item to `SecurityGroups`.
///
/// To override the contents of this collection use [`set_security_groups`](Self::set_security_groups).
///
/// <p>\[Default VPC\] The names of the security groups.</p>
/// <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>
/// <p>Default: Amazon EC2 uses the default security group.</p>
pub fn security_groups(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.inner = self.inner.security_groups(input.into());
self
}
/// <p>\[Default VPC\] The names of the security groups.</p>
/// <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>
/// <p>Default: Amazon EC2 uses the default security group.</p>
pub fn set_security_groups(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
self.inner = self.inner.set_security_groups(input);
self
}
/// <p>\[Default VPC\] The names of the security groups.</p>
/// <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>
/// <p>Default: Amazon EC2 uses the default security group.</p>
pub fn get_security_groups(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
self.inner.get_security_groups()
}
/// <p>The ID of the subnet to launch the instance into.</p>
/// <p>If you specify a network interface, you must specify any subnets as part of the network interface instead of using this parameter.</p>
pub fn subnet_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.inner = self.inner.subnet_id(input.into());
self
}
/// <p>The ID of the subnet to launch the instance into.</p>
/// <p>If you specify a network interface, you must specify any subnets as part of the network interface instead of using this parameter.</p>
pub fn set_subnet_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.inner = self.inner.set_subnet_id(input);
self
}
/// <p>The ID of the subnet to launch the instance into.</p>
/// <p>If you specify a network interface, you must specify any subnets as part of the network interface instead of using this parameter.</p>
pub fn get_subnet_id(&self) -> &::std::option::Option<::std::string::String> {
self.inner.get_subnet_id()
}
/// <p>The user data to make available to the instance. User data must be base64-encoded. Depending on the tool or SDK that you're using, the base64-encoding might be performed for you. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/user-data.html">Run commands at launch using instance user data</a>.</p>
pub fn user_data(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.inner = self.inner.user_data(input.into());
self
}
/// <p>The user data to make available to the instance. User data must be base64-encoded. Depending on the tool or SDK that you're using, the base64-encoding might be performed for you. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/user-data.html">Run commands at launch using instance user data</a>.</p>
pub fn set_user_data(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.inner = self.inner.set_user_data(input);
self
}
/// <p>The user data to make available to the instance. User data must be base64-encoded. Depending on the tool or SDK that you're using, the base64-encoding might be performed for you. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/user-data.html">Run commands at launch using instance user data</a>.</p>
pub fn get_user_data(&self) -> &::std::option::Option<::std::string::String> {
self.inner.get_user_data()
}
///
/// Appends an item to `ElasticGpuSpecification`.
///
/// To override the contents of this collection use [`set_elastic_gpu_specification`](Self::set_elastic_gpu_specification).
///
/// <p>An elastic GPU to associate with the instance.</p><note>
/// <p>Amazon Elastic Graphics reached end of life on January 8, 2024.</p>
/// </note>
#[deprecated(
note = "Specifying Elastic Graphics accelerators is no longer supported on the RunInstances API.",
since = "2024-01-08"
)]
pub fn elastic_gpu_specification(mut self, input: crate::types::ElasticGpuSpecification) -> Self {
self.inner = self.inner.elastic_gpu_specification(input);
self
}
/// <p>An elastic GPU to associate with the instance.</p><note>
/// <p>Amazon Elastic Graphics reached end of life on January 8, 2024.</p>
/// </note>
#[deprecated(
note = "Specifying Elastic Graphics accelerators is no longer supported on the RunInstances API.",
since = "2024-01-08"
)]
pub fn set_elastic_gpu_specification(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::ElasticGpuSpecification>>) -> Self {
self.inner = self.inner.set_elastic_gpu_specification(input);
self
}
/// <p>An elastic GPU to associate with the instance.</p><note>
/// <p>Amazon Elastic Graphics reached end of life on January 8, 2024.</p>
/// </note>
#[deprecated(
note = "Specifying Elastic Graphics accelerators is no longer supported on the RunInstances API.",
since = "2024-01-08"
)]
pub fn get_elastic_gpu_specification(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::ElasticGpuSpecification>> {
self.inner.get_elastic_gpu_specification()
}
///
/// Appends an item to `ElasticInferenceAccelerators`.
///
/// To override the contents of this collection use [`set_elastic_inference_accelerators`](Self::set_elastic_inference_accelerators).
///
/// <p>An elastic inference accelerator to associate with the instance.</p><note>
/// <p>Amazon Elastic Inference is no longer available.</p>
/// </note>
#[deprecated(
note = "Specifying Elastic Inference accelerators is no longer supported on the RunInstances API.",
since = "2024-01-08"
)]
pub fn elastic_inference_accelerators(mut self, input: crate::types::ElasticInferenceAccelerator) -> Self {
self.inner = self.inner.elastic_inference_accelerators(input);
self
}
/// <p>An elastic inference accelerator to associate with the instance.</p><note>
/// <p>Amazon Elastic Inference is no longer available.</p>
/// </note>
#[deprecated(
note = "Specifying Elastic Inference accelerators is no longer supported on the RunInstances API.",
since = "2024-01-08"
)]
pub fn set_elastic_inference_accelerators(
mut self,
input: ::std::option::Option<::std::vec::Vec<crate::types::ElasticInferenceAccelerator>>,
) -> Self {
self.inner = self.inner.set_elastic_inference_accelerators(input);
self
}
/// <p>An elastic inference accelerator to associate with the instance.</p><note>
/// <p>Amazon Elastic Inference is no longer available.</p>
/// </note>
#[deprecated(
note = "Specifying Elastic Inference accelerators is no longer supported on the RunInstances API.",
since = "2024-01-08"
)]
pub fn get_elastic_inference_accelerators(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::ElasticInferenceAccelerator>> {
self.inner.get_elastic_inference_accelerators()
}
///
/// Appends an item to `TagSpecifications`.
///
/// To override the contents of this collection use [`set_tag_specifications`](Self::set_tag_specifications).
///
/// <p>The tags to apply to the resources that are created during instance launch.</p>
/// <p>You can specify tags for the following resources only:</p>
/// <ul>
/// <li>
/// <p>Instances</p></li>
/// <li>
/// <p>Volumes</p></li>
/// <li>
/// <p>Spot Instance requests</p></li>
/// <li>
/// <p>Network interfaces</p></li>
/// </ul>
/// <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>
pub fn tag_specifications(mut self, input: crate::types::TagSpecification) -> Self {
self.inner = self.inner.tag_specifications(input);
self
}
/// <p>The tags to apply to the resources that are created during instance launch.</p>
/// <p>You can specify tags for the following resources only:</p>
/// <ul>
/// <li>
/// <p>Instances</p></li>
/// <li>
/// <p>Volumes</p></li>
/// <li>
/// <p>Spot Instance requests</p></li>
/// <li>
/// <p>Network interfaces</p></li>
/// </ul>
/// <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>
pub fn set_tag_specifications(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::TagSpecification>>) -> Self {
self.inner = self.inner.set_tag_specifications(input);
self
}
/// <p>The tags to apply to the resources that are created during instance launch.</p>
/// <p>You can specify tags for the following resources only:</p>
/// <ul>
/// <li>
/// <p>Instances</p></li>
/// <li>
/// <p>Volumes</p></li>
/// <li>
/// <p>Spot Instance requests</p></li>
/// <li>
/// <p>Network interfaces</p></li>
/// </ul>
/// <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>
pub fn get_tag_specifications(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::TagSpecification>> {
self.inner.get_tag_specifications()
}
/// <p>The launch template. Any additional parameters that you specify for the new instance overwrite the corresponding parameters included in the launch template.</p>
pub fn launch_template(mut self, input: crate::types::LaunchTemplateSpecification) -> Self {
self.inner = self.inner.launch_template(input);
self
}
/// <p>The launch template. Any additional parameters that you specify for the new instance overwrite the corresponding parameters included in the launch template.</p>
pub fn set_launch_template(mut self, input: ::std::option::Option<crate::types::LaunchTemplateSpecification>) -> Self {
self.inner = self.inner.set_launch_template(input);
self
}
/// <p>The launch template. Any additional parameters that you specify for the new instance overwrite the corresponding parameters included in the launch template.</p>
pub fn get_launch_template(&self) -> &::std::option::Option<crate::types::LaunchTemplateSpecification> {
self.inner.get_launch_template()
}
/// <p>The market (purchasing) option for the instances.</p>
/// <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>
pub fn instance_market_options(mut self, input: crate::types::InstanceMarketOptionsRequest) -> Self {
self.inner = self.inner.instance_market_options(input);
self
}
/// <p>The market (purchasing) option for the instances.</p>
/// <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>
pub fn set_instance_market_options(mut self, input: ::std::option::Option<crate::types::InstanceMarketOptionsRequest>) -> Self {
self.inner = self.inner.set_instance_market_options(input);
self
}
/// <p>The market (purchasing) option for the instances.</p>
/// <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>
pub fn get_instance_market_options(&self) -> &::std::option::Option<crate::types::InstanceMarketOptionsRequest> {
self.inner.get_instance_market_options()
}
/// <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>
/// <p>Default: <code>standard</code> (T2 instances) or <code>unlimited</code> (T3/T3a/T4g instances)</p>
/// <p>For T3 instances with <code>host</code> tenancy, only <code>standard</code> is supported.</p>
pub fn credit_specification(mut self, input: crate::types::CreditSpecificationRequest) -> Self {
self.inner = self.inner.credit_specification(input);
self
}
/// <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>
/// <p>Default: <code>standard</code> (T2 instances) or <code>unlimited</code> (T3/T3a/T4g instances)</p>
/// <p>For T3 instances with <code>host</code> tenancy, only <code>standard</code> is supported.</p>
pub fn set_credit_specification(mut self, input: ::std::option::Option<crate::types::CreditSpecificationRequest>) -> Self {
self.inner = self.inner.set_credit_specification(input);
self
}
/// <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>
/// <p>Default: <code>standard</code> (T2 instances) or <code>unlimited</code> (T3/T3a/T4g instances)</p>
/// <p>For T3 instances with <code>host</code> tenancy, only <code>standard</code> is supported.</p>
pub fn get_credit_specification(&self) -> &::std::option::Option<crate::types::CreditSpecificationRequest> {
self.inner.get_credit_specification()
}
/// <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>
pub fn cpu_options(mut self, input: crate::types::CpuOptionsRequest) -> Self {
self.inner = self.inner.cpu_options(input);
self
}
/// <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>
pub fn set_cpu_options(mut self, input: ::std::option::Option<crate::types::CpuOptionsRequest>) -> Self {
self.inner = self.inner.set_cpu_options(input);
self
}
/// <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>
pub fn get_cpu_options(&self) -> &::std::option::Option<crate::types::CpuOptionsRequest> {
self.inner.get_cpu_options()
}
/// <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>
pub fn capacity_reservation_specification(mut self, input: crate::types::CapacityReservationSpecification) -> Self {
self.inner = self.inner.capacity_reservation_specification(input);
self
}
/// <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>
pub fn set_capacity_reservation_specification(mut self, input: ::std::option::Option<crate::types::CapacityReservationSpecification>) -> Self {
self.inner = self.inner.set_capacity_reservation_specification(input);
self
}
/// <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>
pub fn get_capacity_reservation_specification(&self) -> &::std::option::Option<crate::types::CapacityReservationSpecification> {
self.inner.get_capacity_reservation_specification()
}
/// <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>
/// <p>You can't enable hibernation and Amazon Web Services Nitro Enclaves on the same instance.</p>
pub fn hibernation_options(mut self, input: crate::types::HibernationOptionsRequest) -> Self {
self.inner = self.inner.hibernation_options(input);
self
}
/// <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>
/// <p>You can't enable hibernation and Amazon Web Services Nitro Enclaves on the same instance.</p>
pub fn set_hibernation_options(mut self, input: ::std::option::Option<crate::types::HibernationOptionsRequest>) -> Self {
self.inner = self.inner.set_hibernation_options(input);
self
}
/// <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>
/// <p>You can't enable hibernation and Amazon Web Services Nitro Enclaves on the same instance.</p>
pub fn get_hibernation_options(&self) -> &::std::option::Option<crate::types::HibernationOptionsRequest> {
self.inner.get_hibernation_options()
}
///
/// Appends an item to `LicenseSpecifications`.
///
/// To override the contents of this collection use [`set_license_specifications`](Self::set_license_specifications).
///
/// <p>The license configurations.</p>
pub fn license_specifications(mut self, input: crate::types::LicenseConfigurationRequest) -> Self {
self.inner = self.inner.license_specifications(input);
self
}
/// <p>The license configurations.</p>
pub fn set_license_specifications(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::LicenseConfigurationRequest>>) -> Self {
self.inner = self.inner.set_license_specifications(input);
self
}
/// <p>The license configurations.</p>
pub fn get_license_specifications(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::LicenseConfigurationRequest>> {
self.inner.get_license_specifications()
}
/// <p>The metadata options for the instance. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/configuring-instance-metadata-options.html">Configure the Instance Metadata Service options</a>.</p>
pub fn metadata_options(mut self, input: crate::types::InstanceMetadataOptionsRequest) -> Self {
self.inner = self.inner.metadata_options(input);
self
}
/// <p>The metadata options for the instance. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/configuring-instance-metadata-options.html">Configure the Instance Metadata Service options</a>.</p>
pub fn set_metadata_options(mut self, input: ::std::option::Option<crate::types::InstanceMetadataOptionsRequest>) -> Self {
self.inner = self.inner.set_metadata_options(input);
self
}
/// <p>The metadata options for the instance. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/configuring-instance-metadata-options.html">Configure the Instance Metadata Service options</a>.</p>
pub fn get_metadata_options(&self) -> &::std::option::Option<crate::types::InstanceMetadataOptionsRequest> {
self.inner.get_metadata_options()
}
/// <p>Indicates whether the instance is enabled for Amazon Web Services Nitro Enclaves. For more information, see <a href="https://docs.aws.amazon.com/enclaves/latest/user/">Amazon Web Services Nitro Enclaves User Guide</a>.</p>
/// <p>You can't enable Amazon Web Services Nitro Enclaves and hibernation on the same instance.</p>
pub fn enclave_options(mut self, input: crate::types::EnclaveOptionsRequest) -> Self {
self.inner = self.inner.enclave_options(input);
self
}
/// <p>Indicates whether the instance is enabled for Amazon Web Services Nitro Enclaves. For more information, see <a href="https://docs.aws.amazon.com/enclaves/latest/user/">Amazon Web Services Nitro Enclaves User Guide</a>.</p>
/// <p>You can't enable Amazon Web Services Nitro Enclaves and hibernation on the same instance.</p>
pub fn set_enclave_options(mut self, input: ::std::option::Option<crate::types::EnclaveOptionsRequest>) -> Self {
self.inner = self.inner.set_enclave_options(input);
self
}
/// <p>Indicates whether the instance is enabled for Amazon Web Services Nitro Enclaves. For more information, see <a href="https://docs.aws.amazon.com/enclaves/latest/user/">Amazon Web Services Nitro Enclaves User Guide</a>.</p>
/// <p>You can't enable Amazon Web Services Nitro Enclaves and hibernation on the same instance.</p>
pub fn get_enclave_options(&self) -> &::std::option::Option<crate::types::EnclaveOptionsRequest> {
self.inner.get_enclave_options()
}
/// <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>
pub fn private_dns_name_options(mut self, input: crate::types::PrivateDnsNameOptionsRequest) -> Self {
self.inner = self.inner.private_dns_name_options(input);
self
}
/// <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>
pub fn set_private_dns_name_options(mut self, input: ::std::option::Option<crate::types::PrivateDnsNameOptionsRequest>) -> Self {
self.inner = self.inner.set_private_dns_name_options(input);
self
}
/// <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>
pub fn get_private_dns_name_options(&self) -> &::std::option::Option<crate::types::PrivateDnsNameOptionsRequest> {
self.inner.get_private_dns_name_options()
}
/// <p>The maintenance and recovery options for the instance.</p>
pub fn maintenance_options(mut self, input: crate::types::InstanceMaintenanceOptionsRequest) -> Self {
self.inner = self.inner.maintenance_options(input);
self
}
/// <p>The maintenance and recovery options for the instance.</p>
pub fn set_maintenance_options(mut self, input: ::std::option::Option<crate::types::InstanceMaintenanceOptionsRequest>) -> Self {
self.inner = self.inner.set_maintenance_options(input);
self
}
/// <p>The maintenance and recovery options for the instance.</p>
pub fn get_maintenance_options(&self) -> &::std::option::Option<crate::types::InstanceMaintenanceOptionsRequest> {
self.inner.get_maintenance_options()
}
/// <p>Indicates whether an instance is enabled for stop protection. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-stop-protection.html">Enable stop protection for your EC2 instances</a>.</p>
pub fn disable_api_stop(mut self, input: bool) -> Self {
self.inner = self.inner.disable_api_stop(input);
self
}
/// <p>Indicates whether an instance is enabled for stop protection. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-stop-protection.html">Enable stop protection for your EC2 instances</a>.</p>
pub fn set_disable_api_stop(mut self, input: ::std::option::Option<bool>) -> Self {
self.inner = self.inner.set_disable_api_stop(input);
self
}
/// <p>Indicates whether an instance is enabled for stop protection. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-stop-protection.html">Enable stop protection for your EC2 instances</a>.</p>
pub fn get_disable_api_stop(&self) -> &::std::option::Option<bool> {
self.inner.get_disable_api_stop()
}
/// <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>
pub fn enable_primary_ipv6(mut self, input: bool) -> Self {
self.inner = self.inner.enable_primary_ipv6(input);
self
}
/// <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>
pub fn set_enable_primary_ipv6(mut self, input: ::std::option::Option<bool>) -> Self {
self.inner = self.inner.set_enable_primary_ipv6(input);
self
}
/// <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>
pub fn get_enable_primary_ipv6(&self) -> &::std::option::Option<bool> {
self.inner.get_enable_primary_ipv6()
}
/// <p>Contains settings for the network performance options for the instance.</p>
pub fn network_performance_options(mut self, input: crate::types::InstanceNetworkPerformanceOptionsRequest) -> Self {
self.inner = self.inner.network_performance_options(input);
self
}
/// <p>Contains settings for the network performance options for the instance.</p>
pub fn set_network_performance_options(mut self, input: ::std::option::Option<crate::types::InstanceNetworkPerformanceOptionsRequest>) -> Self {
self.inner = self.inner.set_network_performance_options(input);
self
}
/// <p>Contains settings for the network performance options for the instance.</p>
pub fn get_network_performance_options(&self) -> &::std::option::Option<crate::types::InstanceNetworkPerformanceOptionsRequest> {
self.inner.get_network_performance_options()
}
/// <p>Reserved for internal use.</p>
pub fn operator(mut self, input: crate::types::OperatorRequest) -> Self {
self.inner = self.inner.operator(input);
self
}
/// <p>Reserved for internal use.</p>
pub fn set_operator(mut self, input: ::std::option::Option<crate::types::OperatorRequest>) -> Self {
self.inner = self.inner.set_operator(input);
self
}
/// <p>Reserved for internal use.</p>
pub fn get_operator(&self) -> &::std::option::Option<crate::types::OperatorRequest> {
self.inner.get_operator()
}
///
/// Appends an item to `SecondaryInterfaces`.
///
/// To override the contents of this collection use [`set_secondary_interfaces`](Self::set_secondary_interfaces).
///
/// <p>The secondary interfaces to associate with the instance.</p>
pub fn secondary_interfaces(mut self, input: crate::types::InstanceSecondaryInterfaceSpecificationRequest) -> Self {
self.inner = self.inner.secondary_interfaces(input);
self
}
/// <p>The secondary interfaces to associate with the instance.</p>
pub fn set_secondary_interfaces(
mut self,
input: ::std::option::Option<::std::vec::Vec<crate::types::InstanceSecondaryInterfaceSpecificationRequest>>,
) -> Self {
self.inner = self.inner.set_secondary_interfaces(input);
self
}
/// <p>The secondary interfaces to associate with the instance.</p>
pub fn get_secondary_interfaces(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::InstanceSecondaryInterfaceSpecificationRequest>> {
self.inner.get_secondary_interfaces()
}
/// <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>
pub fn dry_run(mut self, input: bool) -> Self {
self.inner = self.inner.dry_run(input);
self
}
/// <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>
pub fn set_dry_run(mut self, input: ::std::option::Option<bool>) -> Self {
self.inner = self.inner.set_dry_run(input);
self
}
/// <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>
pub fn get_dry_run(&self) -> &::std::option::Option<bool> {
self.inner.get_dry_run()
}
/// <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>
pub fn disable_api_termination(mut self, input: bool) -> Self {
self.inner = self.inner.disable_api_termination(input);
self
}
/// <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>
pub fn set_disable_api_termination(mut self, input: ::std::option::Option<bool>) -> Self {
self.inner = self.inner.set_disable_api_termination(input);
self
}
/// <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>
pub fn get_disable_api_termination(&self) -> &::std::option::Option<bool> {
self.inner.get_disable_api_termination()
}
/// <p>Indicates whether an instance stops or terminates when you initiate shutdown from the instance (using the operating system command for system shutdown).</p>
/// <p>Default: <code>stop</code></p>
pub fn instance_initiated_shutdown_behavior(mut self, input: crate::types::ShutdownBehavior) -> Self {
self.inner = self.inner.instance_initiated_shutdown_behavior(input);
self
}
/// <p>Indicates whether an instance stops or terminates when you initiate shutdown from the instance (using the operating system command for system shutdown).</p>
/// <p>Default: <code>stop</code></p>
pub fn set_instance_initiated_shutdown_behavior(mut self, input: ::std::option::Option<crate::types::ShutdownBehavior>) -> Self {
self.inner = self.inner.set_instance_initiated_shutdown_behavior(input);
self
}
/// <p>Indicates whether an instance stops or terminates when you initiate shutdown from the instance (using the operating system command for system shutdown).</p>
/// <p>Default: <code>stop</code></p>
pub fn get_instance_initiated_shutdown_behavior(&self) -> &::std::option::Option<crate::types::ShutdownBehavior> {
self.inner.get_instance_initiated_shutdown_behavior()
}
/// <p>The primary IPv4 address. You must specify a value from the IPv4 address range of the subnet.</p>
/// <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>
/// <p>You cannot specify this option and the network interfaces option in the same request.</p>
pub fn private_ip_address(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.inner = self.inner.private_ip_address(input.into());
self
}
/// <p>The primary IPv4 address. You must specify a value from the IPv4 address range of the subnet.</p>
/// <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>
/// <p>You cannot specify this option and the network interfaces option in the same request.</p>
pub fn set_private_ip_address(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.inner = self.inner.set_private_ip_address(input);
self
}
/// <p>The primary IPv4 address. You must specify a value from the IPv4 address range of the subnet.</p>
/// <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>
/// <p>You cannot specify this option and the network interfaces option in the same request.</p>
pub fn get_private_ip_address(&self) -> &::std::option::Option<::std::string::String> {
self.inner.get_private_ip_address()
}
/// <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>
/// <p>For more information, see <a href="https://docs.aws.amazon.com/ec2/latest/devguide/ec2-api-idempotency.html">Ensuring idempotency in Amazon EC2 API requests</a>.</p>
/// <p>Constraints: Maximum 64 ASCII characters</p>
pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.inner = self.inner.client_token(input.into());
self
}
/// <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>
/// <p>For more information, see <a href="https://docs.aws.amazon.com/ec2/latest/devguide/ec2-api-idempotency.html">Ensuring idempotency in Amazon EC2 API requests</a>.</p>
/// <p>Constraints: Maximum 64 ASCII characters</p>
pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.inner = self.inner.set_client_token(input);
self
}
/// <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>
/// <p>For more information, see <a href="https://docs.aws.amazon.com/ec2/latest/devguide/ec2-api-idempotency.html">Ensuring idempotency in Amazon EC2 API requests</a>.</p>
/// <p>Constraints: Maximum 64 ASCII characters</p>
pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
self.inner.get_client_token()
}
/// <p>Reserved.</p>
pub fn additional_info(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.inner = self.inner.additional_info(input.into());
self
}
/// <p>Reserved.</p>
pub fn set_additional_info(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.inner = self.inner.set_additional_info(input);
self
}
/// <p>Reserved.</p>
pub fn get_additional_info(&self) -> &::std::option::Option<::std::string::String> {
self.inner.get_additional_info()
}
///
/// Appends an item to `NetworkInterfaces`.
///
/// To override the contents of this collection use [`set_network_interfaces`](Self::set_network_interfaces).
///
/// <p>The network interfaces to associate with the instance.</p>
pub fn network_interfaces(mut self, input: crate::types::InstanceNetworkInterfaceSpecification) -> Self {
self.inner = self.inner.network_interfaces(input);
self
}
/// <p>The network interfaces to associate with the instance.</p>
pub fn set_network_interfaces(
mut self,
input: ::std::option::Option<::std::vec::Vec<crate::types::InstanceNetworkInterfaceSpecification>>,
) -> Self {
self.inner = self.inner.set_network_interfaces(input);
self
}
/// <p>The network interfaces to associate with the instance.</p>
pub fn get_network_interfaces(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::InstanceNetworkInterfaceSpecification>> {
self.inner.get_network_interfaces()
}
/// <p>The name or Amazon Resource Name (ARN) of an IAM instance profile.</p>
pub fn iam_instance_profile(mut self, input: crate::types::IamInstanceProfileSpecification) -> Self {
self.inner = self.inner.iam_instance_profile(input);
self
}
/// <p>The name or Amazon Resource Name (ARN) of an IAM instance profile.</p>
pub fn set_iam_instance_profile(mut self, input: ::std::option::Option<crate::types::IamInstanceProfileSpecification>) -> Self {
self.inner = self.inner.set_iam_instance_profile(input);
self
}
/// <p>The name or Amazon Resource Name (ARN) of an IAM instance profile.</p>
pub fn get_iam_instance_profile(&self) -> &::std::option::Option<crate::types::IamInstanceProfileSpecification> {
self.inner.get_iam_instance_profile()
}
/// <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>
/// <p>Default: <code>false</code></p>
pub fn ebs_optimized(mut self, input: bool) -> Self {
self.inner = self.inner.ebs_optimized(input);
self
}
/// <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>
/// <p>Default: <code>false</code></p>
pub fn set_ebs_optimized(mut self, input: ::std::option::Option<bool>) -> Self {
self.inner = self.inner.set_ebs_optimized(input);
self
}
/// <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>
/// <p>Default: <code>false</code></p>
pub fn get_ebs_optimized(&self) -> &::std::option::Option<bool> {
self.inner.get_ebs_optimized()
}
}