pub struct Builder { /* private fields */ }
Expand description

Implementations§

Enable or disable source/destination checks, which ensure that the instance is either the source or the destination of any traffic that it receives. If the value is true, source/destination checks are enabled; otherwise, they are disabled. The default value is true. You must disable source/destination checks if the instance runs services such as network address translation, routing, or firewalls.

Examples found in repository?
src/client.rs (line 64676)
64675
64676
64677
64678
        pub fn source_dest_check(mut self, input: crate::model::AttributeBooleanValue) -> Self {
            self.inner = self.inner.source_dest_check(input);
            self
        }

Enable or disable source/destination checks, which ensure that the instance is either the source or the destination of any traffic that it receives. If the value is true, source/destination checks are enabled; otherwise, they are disabled. The default value is true. You must disable source/destination checks if the instance runs services such as network address translation, routing, or firewalls.

Examples found in repository?
src/client.rs (line 64684)
64680
64681
64682
64683
64684
64685
64686
        pub fn set_source_dest_check(
            mut self,
            input: std::option::Option<crate::model::AttributeBooleanValue>,
        ) -> Self {
            self.inner = self.inner.set_source_dest_check(input);
            self
        }

The name of the attribute to modify.

You can modify the following attributes only: disableApiTermination | instanceType | kernel | ramdisk | instanceInitiatedShutdownBehavior | blockDeviceMapping | userData | sourceDestCheck | groupSet | ebsOptimized | sriovNetSupport | enaSupport | nvmeSupport | disableApiStop | enclaveOptions

Examples found in repository?
src/client.rs (line 64691)
64690
64691
64692
64693
        pub fn attribute(mut self, input: crate::model::InstanceAttributeName) -> Self {
            self.inner = self.inner.attribute(input);
            self
        }

The name of the attribute to modify.

You can modify the following attributes only: disableApiTermination | instanceType | kernel | ramdisk | instanceInitiatedShutdownBehavior | blockDeviceMapping | userData | sourceDestCheck | groupSet | ebsOptimized | sriovNetSupport | enaSupport | nvmeSupport | disableApiStop | enclaveOptions

Examples found in repository?
src/client.rs (line 64701)
64697
64698
64699
64700
64701
64702
64703
        pub fn set_attribute(
            mut self,
            input: std::option::Option<crate::model::InstanceAttributeName>,
        ) -> Self {
            self.inner = self.inner.set_attribute(input);
            self
        }

Appends an item to block_device_mappings.

To override the contents of this collection use set_block_device_mappings.

Modifies the DeleteOnTermination attribute for volumes that are currently attached. The volume must be owned by the caller. If no value is specified for DeleteOnTermination, the default is true and the volume is deleted when the instance is terminated.

To add instance store volumes to an Amazon EBS-backed instance, you must add them when you launch the instance. For more information, see Update the block device mapping when launching an instance in the Amazon EC2 User Guide.

Examples found in repository?
src/client.rs (line 64714)
64710
64711
64712
64713
64714
64715
64716
        pub fn block_device_mappings(
            mut self,
            input: crate::model::InstanceBlockDeviceMappingSpecification,
        ) -> Self {
            self.inner = self.inner.block_device_mappings(input);
            self
        }

Modifies the DeleteOnTermination attribute for volumes that are currently attached. The volume must be owned by the caller. If no value is specified for DeleteOnTermination, the default is true and the volume is deleted when the instance is terminated.

To add instance store volumes to an Amazon EBS-backed instance, you must add them when you launch the instance. For more information, see Update the block device mapping when launching an instance in the Amazon EC2 User Guide.

Examples found in repository?
src/client.rs (line 64725)
64719
64720
64721
64722
64723
64724
64725
64726
64727
        pub fn set_block_device_mappings(
            mut self,
            input: std::option::Option<
                std::vec::Vec<crate::model::InstanceBlockDeviceMappingSpecification>,
            >,
        ) -> Self {
            self.inner = self.inner.set_block_device_mappings(input);
            self
        }

If the value is true, you can't terminate the instance using the Amazon EC2 console, CLI, or API; otherwise, you can. You cannot use this parameter for Spot Instances.

Examples found in repository?
src/client.rs (line 64733)
64729
64730
64731
64732
64733
64734
64735
        pub fn disable_api_termination(
            mut self,
            input: crate::model::AttributeBooleanValue,
        ) -> Self {
            self.inner = self.inner.disable_api_termination(input);
            self
        }

If the value is true, you can't terminate the instance using the Amazon EC2 console, CLI, or API; otherwise, you can. You cannot use this parameter for Spot Instances.

Examples found in repository?
src/client.rs (line 64741)
64737
64738
64739
64740
64741
64742
64743
        pub fn set_disable_api_termination(
            mut self,
            input: std::option::Option<crate::model::AttributeBooleanValue>,
        ) -> Self {
            self.inner = self.inner.set_disable_api_termination(input);
            self
        }

Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation. Otherwise, it is UnauthorizedOperation.

Examples found in repository?
src/client.rs (line 64746)
64745
64746
64747
64748
        pub fn dry_run(mut self, input: bool) -> Self {
            self.inner = self.inner.dry_run(input);
            self
        }

Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation. Otherwise, it is UnauthorizedOperation.

Examples found in repository?
src/client.rs (line 64751)
64750
64751
64752
64753
        pub fn set_dry_run(mut self, input: std::option::Option<bool>) -> Self {
            self.inner = self.inner.set_dry_run(input);
            self
        }

Specifies 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 EBS I/O performance. This optimization isn't available with all instance types. Additional usage charges apply when using an EBS Optimized instance.

Examples found in repository?
src/client.rs (line 64756)
64755
64756
64757
64758
        pub fn ebs_optimized(mut self, input: crate::model::AttributeBooleanValue) -> Self {
            self.inner = self.inner.ebs_optimized(input);
            self
        }

Specifies 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 EBS I/O performance. This optimization isn't available with all instance types. Additional usage charges apply when using an EBS Optimized instance.

Examples found in repository?
src/client.rs (line 64764)
64760
64761
64762
64763
64764
64765
64766
        pub fn set_ebs_optimized(
            mut self,
            input: std::option::Option<crate::model::AttributeBooleanValue>,
        ) -> Self {
            self.inner = self.inner.set_ebs_optimized(input);
            self
        }

Set to true to enable enhanced networking with ENA for the instance.

This option is supported only for HVM instances. Specifying this option with a PV instance can make it unreachable.

Examples found in repository?
src/client.rs (line 64770)
64769
64770
64771
64772
        pub fn ena_support(mut self, input: crate::model::AttributeBooleanValue) -> Self {
            self.inner = self.inner.ena_support(input);
            self
        }

Set to true to enable enhanced networking with ENA for the instance.

This option is supported only for HVM instances. Specifying this option with a PV instance can make it unreachable.

Examples found in repository?
src/client.rs (line 64779)
64775
64776
64777
64778
64779
64780
64781
        pub fn set_ena_support(
            mut self,
            input: std::option::Option<crate::model::AttributeBooleanValue>,
        ) -> Self {
            self.inner = self.inner.set_ena_support(input);
            self
        }

Appends an item to groups.

To override the contents of this collection use set_groups.

[EC2-VPC] Replaces the security groups of the instance with the specified security groups. You must specify at least one security group, even if it's just the default security group for the VPC. You must specify the security group ID, not the security group name.

Examples found in repository?
src/client.rs (line 64788)
64787
64788
64789
64790
        pub fn groups(mut self, input: impl Into<std::string::String>) -> Self {
            self.inner = self.inner.groups(input.into());
            self
        }

[EC2-VPC] Replaces the security groups of the instance with the specified security groups. You must specify at least one security group, even if it's just the default security group for the VPC. You must specify the security group ID, not the security group name.

Examples found in repository?
src/client.rs (line 64796)
64792
64793
64794
64795
64796
64797
64798
        pub fn set_groups(
            mut self,
            input: std::option::Option<std::vec::Vec<std::string::String>>,
        ) -> Self {
            self.inner = self.inner.set_groups(input);
            self
        }

The ID of the instance.

Examples found in repository?
src/client.rs (line 64801)
64800
64801
64802
64803
        pub fn instance_id(mut self, input: impl Into<std::string::String>) -> Self {
            self.inner = self.inner.instance_id(input.into());
            self
        }

The ID of the instance.

Examples found in repository?
src/client.rs (line 64806)
64805
64806
64807
64808
        pub fn set_instance_id(mut self, input: std::option::Option<std::string::String>) -> Self {
            self.inner = self.inner.set_instance_id(input);
            self
        }

Specifies whether an instance stops or terminates when you initiate shutdown from the instance (using the operating system command for system shutdown).

Examples found in repository?
src/client.rs (line 64814)
64810
64811
64812
64813
64814
64815
64816
        pub fn instance_initiated_shutdown_behavior(
            mut self,
            input: crate::model::AttributeValue,
        ) -> Self {
            self.inner = self.inner.instance_initiated_shutdown_behavior(input);
            self
        }

Specifies whether an instance stops or terminates when you initiate shutdown from the instance (using the operating system command for system shutdown).

Examples found in repository?
src/client.rs (line 64822)
64818
64819
64820
64821
64822
64823
64824
        pub fn set_instance_initiated_shutdown_behavior(
            mut self,
            input: std::option::Option<crate::model::AttributeValue>,
        ) -> Self {
            self.inner = self.inner.set_instance_initiated_shutdown_behavior(input);
            self
        }

Changes the instance type to the specified value. For more information, see Instance types in the Amazon EC2 User Guide. If the instance type is not valid, the error returned is InvalidInstanceAttributeValue.

Examples found in repository?
src/client.rs (line 64827)
64826
64827
64828
64829
        pub fn instance_type(mut self, input: crate::model::AttributeValue) -> Self {
            self.inner = self.inner.instance_type(input);
            self
        }

Changes the instance type to the specified value. For more information, see Instance types in the Amazon EC2 User Guide. If the instance type is not valid, the error returned is InvalidInstanceAttributeValue.

Examples found in repository?
src/client.rs (line 64835)
64831
64832
64833
64834
64835
64836
64837
        pub fn set_instance_type(
            mut self,
            input: std::option::Option<crate::model::AttributeValue>,
        ) -> Self {
            self.inner = self.inner.set_instance_type(input);
            self
        }

Changes the instance's kernel to the specified value. We recommend that you use PV-GRUB instead of kernels and RAM disks. For more information, see PV-GRUB.

Examples found in repository?
src/client.rs (line 64840)
64839
64840
64841
64842
        pub fn kernel(mut self, input: crate::model::AttributeValue) -> Self {
            self.inner = self.inner.kernel(input);
            self
        }

Changes the instance's kernel to the specified value. We recommend that you use PV-GRUB instead of kernels and RAM disks. For more information, see PV-GRUB.

Examples found in repository?
src/client.rs (line 64848)
64844
64845
64846
64847
64848
64849
64850
        pub fn set_kernel(
            mut self,
            input: std::option::Option<crate::model::AttributeValue>,
        ) -> Self {
            self.inner = self.inner.set_kernel(input);
            self
        }

Changes the instance's RAM disk to the specified value. We recommend that you use PV-GRUB instead of kernels and RAM disks. For more information, see PV-GRUB.

Examples found in repository?
src/client.rs (line 64853)
64852
64853
64854
64855
        pub fn ramdisk(mut self, input: crate::model::AttributeValue) -> Self {
            self.inner = self.inner.ramdisk(input);
            self
        }

Changes the instance's RAM disk to the specified value. We recommend that you use PV-GRUB instead of kernels and RAM disks. For more information, see PV-GRUB.

Examples found in repository?
src/client.rs (line 64861)
64857
64858
64859
64860
64861
64862
64863
        pub fn set_ramdisk(
            mut self,
            input: std::option::Option<crate::model::AttributeValue>,
        ) -> Self {
            self.inner = self.inner.set_ramdisk(input);
            self
        }

Set to simple to enable enhanced networking with the Intel 82599 Virtual Function interface for the instance.

There is no way to disable enhanced networking with the Intel 82599 Virtual Function interface at this time.

This option is supported only for HVM instances. Specifying this option with a PV instance can make it unreachable.

Examples found in repository?
src/client.rs (line 64868)
64867
64868
64869
64870
        pub fn sriov_net_support(mut self, input: crate::model::AttributeValue) -> Self {
            self.inner = self.inner.sriov_net_support(input);
            self
        }

Set to simple to enable enhanced networking with the Intel 82599 Virtual Function interface for the instance.

There is no way to disable enhanced networking with the Intel 82599 Virtual Function interface at this time.

This option is supported only for HVM instances. Specifying this option with a PV instance can make it unreachable.

Examples found in repository?
src/client.rs (line 64878)
64874
64875
64876
64877
64878
64879
64880
        pub fn set_sriov_net_support(
            mut self,
            input: std::option::Option<crate::model::AttributeValue>,
        ) -> Self {
            self.inner = self.inner.set_sriov_net_support(input);
            self
        }

Changes the instance's user data to the specified value. If you are using an Amazon Web Services SDK or command line tool, base64-encoding is performed for you, and you can load the text from a file. Otherwise, you must provide base64-encoded text.

Examples found in repository?
src/client.rs (line 64883)
64882
64883
64884
64885
        pub fn user_data(mut self, input: crate::model::BlobAttributeValue) -> Self {
            self.inner = self.inner.user_data(input);
            self
        }

Changes the instance's user data to the specified value. If you are using an Amazon Web Services SDK or command line tool, base64-encoding is performed for you, and you can load the text from a file. Otherwise, you must provide base64-encoded text.

Examples found in repository?
src/client.rs (line 64891)
64887
64888
64889
64890
64891
64892
64893
        pub fn set_user_data(
            mut self,
            input: std::option::Option<crate::model::BlobAttributeValue>,
        ) -> Self {
            self.inner = self.inner.set_user_data(input);
            self
        }

A new value for the attribute. Use only with the kernel, ramdisk, userData, disableApiTermination, or instanceInitiatedShutdownBehavior attribute.

Examples found in repository?
src/client.rs (line 64896)
64895
64896
64897
64898
        pub fn value(mut self, input: impl Into<std::string::String>) -> Self {
            self.inner = self.inner.value(input.into());
            self
        }

A new value for the attribute. Use only with the kernel, ramdisk, userData, disableApiTermination, or instanceInitiatedShutdownBehavior attribute.

Examples found in repository?
src/client.rs (line 64901)
64900
64901
64902
64903
        pub fn set_value(mut self, input: std::option::Option<std::string::String>) -> Self {
            self.inner = self.inner.set_value(input);
            self
        }

Indicates whether an instance is enabled for stop protection. For more information, see Stop Protection.

Examples found in repository?
src/client.rs (line 64907)
64906
64907
64908
64909
        pub fn disable_api_stop(mut self, input: crate::model::AttributeBooleanValue) -> Self {
            self.inner = self.inner.disable_api_stop(input);
            self
        }

Indicates whether an instance is enabled for stop protection. For more information, see Stop Protection.

Examples found in repository?
src/client.rs (line 64916)
64912
64913
64914
64915
64916
64917
64918
        pub fn set_disable_api_stop(
            mut self,
            input: std::option::Option<crate::model::AttributeBooleanValue>,
        ) -> Self {
            self.inner = self.inner.set_disable_api_stop(input);
            self
        }

Consumes the builder and constructs a ModifyInstanceAttributeInput.

Examples found in repository?
src/client.rs (line 64643)
64631
64632
64633
64634
64635
64636
64637
64638
64639
64640
64641
64642
64643
64644
64645
64646
64647
64648
64649
64650
64651
64652
64653
64654
64655
64656
64657
64658
64659
64660
64661
64662
64663
64664
64665
64666
64667
64668
64669
64670
64671
64672
64673
        pub async fn customize(
            self,
        ) -> std::result::Result<
            crate::operation::customize::CustomizableOperation<
                crate::operation::ModifyInstanceAttribute,
                aws_http::retry::AwsResponseRetryClassifier,
            >,
            aws_smithy_http::result::SdkError<crate::error::ModifyInstanceAttributeError>,
        > {
            let handle = self.handle.clone();
            let operation = self
                .inner
                .build()
                .map_err(aws_smithy_http::result::SdkError::construction_failure)?
                .make_operation(&handle.conf)
                .await
                .map_err(aws_smithy_http::result::SdkError::construction_failure)?;
            Ok(crate::operation::customize::CustomizableOperation { handle, operation })
        }

        /// 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::output::ModifyInstanceAttributeOutput,
            aws_smithy_http::result::SdkError<crate::error::ModifyInstanceAttributeError>,
        > {
            let op = self
                .inner
                .build()
                .map_err(aws_smithy_http::result::SdkError::construction_failure)?
                .make_operation(&self.handle.conf)
                .await
                .map_err(aws_smithy_http::result::SdkError::construction_failure)?;
            self.handle.client.call(op).await
        }

Trait Implementations§

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more
Returns the “default value” for a type. Read more
This method tests for self and other values to be equal, and is used by ==. Read more
This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason. Read more

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Should always be Self
The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.
Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more