aws_sdk_eks/operation/update_nodegroup_version/builders.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::update_nodegroup_version::_update_nodegroup_version_output::UpdateNodegroupVersionOutputBuilder;
3
4pub use crate::operation::update_nodegroup_version::_update_nodegroup_version_input::UpdateNodegroupVersionInputBuilder;
5
6impl crate::operation::update_nodegroup_version::builders::UpdateNodegroupVersionInputBuilder {
7 /// Sends a request with this input using the given client.
8 pub async fn send_with(
9 self,
10 client: &crate::Client,
11 ) -> ::std::result::Result<
12 crate::operation::update_nodegroup_version::UpdateNodegroupVersionOutput,
13 ::aws_smithy_runtime_api::client::result::SdkError<
14 crate::operation::update_nodegroup_version::UpdateNodegroupVersionError,
15 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16 >,
17 > {
18 let mut fluent_builder = client.update_nodegroup_version();
19 fluent_builder.inner = self;
20 fluent_builder.send().await
21 }
22}
23/// Fluent builder constructing a request to `UpdateNodegroupVersion`.
24///
25/// <p>Updates the Kubernetes version or AMI version of an Amazon EKS managed node group.</p>
26/// <p>You can update a node group using a launch template only if the node group was originally deployed with a launch template. Additionally, the launch template ID or name must match what was used when the node group was created. You can update the launch template version with necessary changes.</p>
27/// <p>If you need to update a custom AMI in a node group that was deployed with a launch template, then update your custom AMI, specify the new ID in a new version of the launch template, and then update the node group to the new version of the launch template.</p>
28/// <p>If you update without a launch template, then you can update to the latest available AMI version of a node group's current Kubernetes version by not specifying a Kubernetes version in the request. You can update to the latest AMI version of your cluster's current Kubernetes version by specifying your cluster's Kubernetes version in the request. For information about Linux versions, see <a href="https://docs.aws.amazon.com/eks/latest/userguide/eks-linux-ami-versions.html">Amazon EKS optimized Amazon Linux AMI versions</a> in the <i>Amazon EKS User Guide</i>. For information about Windows versions, see <a href="https://docs.aws.amazon.com/eks/latest/userguide/eks-ami-versions-windows.html">Amazon EKS optimized Windows AMI versions</a> in the <i>Amazon EKS User Guide</i>.</p>
29/// <p>You cannot roll back a node group to an earlier Kubernetes version or AMI version.</p>
30/// <p>When a node in a managed node group is terminated due to a scaling action or update, every <code>Pod</code> on that node is drained first. Amazon EKS attempts to drain the nodes gracefully and will fail if it is unable to do so. You can <code>force</code> the update if Amazon EKS is unable to drain the nodes as a result of a <code>Pod</code> disruption budget issue.</p>
31#[derive(::std::clone::Clone, ::std::fmt::Debug)]
32pub struct UpdateNodegroupVersionFluentBuilder {
33 handle: ::std::sync::Arc<crate::client::Handle>,
34 inner: crate::operation::update_nodegroup_version::builders::UpdateNodegroupVersionInputBuilder,
35 config_override: ::std::option::Option<crate::config::Builder>,
36}
37impl
38 crate::client::customize::internal::CustomizableSend<
39 crate::operation::update_nodegroup_version::UpdateNodegroupVersionOutput,
40 crate::operation::update_nodegroup_version::UpdateNodegroupVersionError,
41 > for UpdateNodegroupVersionFluentBuilder
42{
43 fn send(
44 self,
45 config_override: crate::config::Builder,
46 ) -> crate::client::customize::internal::BoxFuture<
47 crate::client::customize::internal::SendResult<
48 crate::operation::update_nodegroup_version::UpdateNodegroupVersionOutput,
49 crate::operation::update_nodegroup_version::UpdateNodegroupVersionError,
50 >,
51 > {
52 ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
53 }
54}
55impl UpdateNodegroupVersionFluentBuilder {
56 /// Creates a new `UpdateNodegroupVersionFluentBuilder`.
57 pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
58 Self {
59 handle,
60 inner: ::std::default::Default::default(),
61 config_override: ::std::option::Option::None,
62 }
63 }
64 /// Access the UpdateNodegroupVersion as a reference.
65 pub fn as_input(&self) -> &crate::operation::update_nodegroup_version::builders::UpdateNodegroupVersionInputBuilder {
66 &self.inner
67 }
68 /// Sends the request and returns the response.
69 ///
70 /// If an error occurs, an `SdkError` will be returned with additional details that
71 /// can be matched against.
72 ///
73 /// By default, any retryable failures will be retried twice. Retry behavior
74 /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
75 /// set when configuring the client.
76 pub async fn send(
77 self,
78 ) -> ::std::result::Result<
79 crate::operation::update_nodegroup_version::UpdateNodegroupVersionOutput,
80 ::aws_smithy_runtime_api::client::result::SdkError<
81 crate::operation::update_nodegroup_version::UpdateNodegroupVersionError,
82 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
83 >,
84 > {
85 let input = self
86 .inner
87 .build()
88 .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
89 let runtime_plugins = crate::operation::update_nodegroup_version::UpdateNodegroupVersion::operation_runtime_plugins(
90 self.handle.runtime_plugins.clone(),
91 &self.handle.conf,
92 self.config_override,
93 );
94 crate::operation::update_nodegroup_version::UpdateNodegroupVersion::orchestrate(&runtime_plugins, input).await
95 }
96
97 /// Consumes this builder, creating a customizable operation that can be modified before being sent.
98 pub fn customize(
99 self,
100 ) -> crate::client::customize::CustomizableOperation<
101 crate::operation::update_nodegroup_version::UpdateNodegroupVersionOutput,
102 crate::operation::update_nodegroup_version::UpdateNodegroupVersionError,
103 Self,
104 > {
105 crate::client::customize::CustomizableOperation::new(self)
106 }
107 pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
108 self.set_config_override(::std::option::Option::Some(config_override.into()));
109 self
110 }
111
112 pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
113 self.config_override = config_override;
114 self
115 }
116 /// <p>The name of your cluster.</p>
117 pub fn cluster_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
118 self.inner = self.inner.cluster_name(input.into());
119 self
120 }
121 /// <p>The name of your cluster.</p>
122 pub fn set_cluster_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
123 self.inner = self.inner.set_cluster_name(input);
124 self
125 }
126 /// <p>The name of your cluster.</p>
127 pub fn get_cluster_name(&self) -> &::std::option::Option<::std::string::String> {
128 self.inner.get_cluster_name()
129 }
130 /// <p>The name of the managed node group to update.</p>
131 pub fn nodegroup_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
132 self.inner = self.inner.nodegroup_name(input.into());
133 self
134 }
135 /// <p>The name of the managed node group to update.</p>
136 pub fn set_nodegroup_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
137 self.inner = self.inner.set_nodegroup_name(input);
138 self
139 }
140 /// <p>The name of the managed node group to update.</p>
141 pub fn get_nodegroup_name(&self) -> &::std::option::Option<::std::string::String> {
142 self.inner.get_nodegroup_name()
143 }
144 /// <p>The Kubernetes version to update to. If no version is specified, then the Kubernetes version of the node group does not change. You can specify the Kubernetes version of the cluster to update the node group to the latest AMI version of the cluster's Kubernetes version. If you specify <code>launchTemplate</code>, and your launch template uses a custom AMI, then don't specify <code>version</code>, or the node group update will fail. For more information about using launch templates with Amazon EKS, see <a href="https://docs.aws.amazon.com/eks/latest/userguide/launch-templates.html">Customizing managed nodes with launch templates</a> in the <i>Amazon EKS User Guide</i>.</p>
145 pub fn version(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
146 self.inner = self.inner.version(input.into());
147 self
148 }
149 /// <p>The Kubernetes version to update to. If no version is specified, then the Kubernetes version of the node group does not change. You can specify the Kubernetes version of the cluster to update the node group to the latest AMI version of the cluster's Kubernetes version. If you specify <code>launchTemplate</code>, and your launch template uses a custom AMI, then don't specify <code>version</code>, or the node group update will fail. For more information about using launch templates with Amazon EKS, see <a href="https://docs.aws.amazon.com/eks/latest/userguide/launch-templates.html">Customizing managed nodes with launch templates</a> in the <i>Amazon EKS User Guide</i>.</p>
150 pub fn set_version(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
151 self.inner = self.inner.set_version(input);
152 self
153 }
154 /// <p>The Kubernetes version to update to. If no version is specified, then the Kubernetes version of the node group does not change. You can specify the Kubernetes version of the cluster to update the node group to the latest AMI version of the cluster's Kubernetes version. If you specify <code>launchTemplate</code>, and your launch template uses a custom AMI, then don't specify <code>version</code>, or the node group update will fail. For more information about using launch templates with Amazon EKS, see <a href="https://docs.aws.amazon.com/eks/latest/userguide/launch-templates.html">Customizing managed nodes with launch templates</a> in the <i>Amazon EKS User Guide</i>.</p>
155 pub fn get_version(&self) -> &::std::option::Option<::std::string::String> {
156 self.inner.get_version()
157 }
158 /// <p>The AMI version of the Amazon EKS optimized AMI to use for the update. By default, the latest available AMI version for the node group's Kubernetes version is used. For information about Linux versions, see <a href="https://docs.aws.amazon.com/eks/latest/userguide/eks-linux-ami-versions.html">Amazon EKS optimized Amazon Linux AMI versions</a> in the <i>Amazon EKS User Guide</i>. Amazon EKS managed node groups support the November 2022 and later releases of the Windows AMIs. For information about Windows versions, see <a href="https://docs.aws.amazon.com/eks/latest/userguide/eks-ami-versions-windows.html">Amazon EKS optimized Windows AMI versions</a> in the <i>Amazon EKS User Guide</i>.</p>
159 /// <p>If you specify <code>launchTemplate</code>, and your launch template uses a custom AMI, then don't specify <code>releaseVersion</code>, or the node group update will fail. For more information about using launch templates with Amazon EKS, see <a href="https://docs.aws.amazon.com/eks/latest/userguide/launch-templates.html">Customizing managed nodes with launch templates</a> in the <i>Amazon EKS User Guide</i>.</p>
160 pub fn release_version(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
161 self.inner = self.inner.release_version(input.into());
162 self
163 }
164 /// <p>The AMI version of the Amazon EKS optimized AMI to use for the update. By default, the latest available AMI version for the node group's Kubernetes version is used. For information about Linux versions, see <a href="https://docs.aws.amazon.com/eks/latest/userguide/eks-linux-ami-versions.html">Amazon EKS optimized Amazon Linux AMI versions</a> in the <i>Amazon EKS User Guide</i>. Amazon EKS managed node groups support the November 2022 and later releases of the Windows AMIs. For information about Windows versions, see <a href="https://docs.aws.amazon.com/eks/latest/userguide/eks-ami-versions-windows.html">Amazon EKS optimized Windows AMI versions</a> in the <i>Amazon EKS User Guide</i>.</p>
165 /// <p>If you specify <code>launchTemplate</code>, and your launch template uses a custom AMI, then don't specify <code>releaseVersion</code>, or the node group update will fail. For more information about using launch templates with Amazon EKS, see <a href="https://docs.aws.amazon.com/eks/latest/userguide/launch-templates.html">Customizing managed nodes with launch templates</a> in the <i>Amazon EKS User Guide</i>.</p>
166 pub fn set_release_version(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
167 self.inner = self.inner.set_release_version(input);
168 self
169 }
170 /// <p>The AMI version of the Amazon EKS optimized AMI to use for the update. By default, the latest available AMI version for the node group's Kubernetes version is used. For information about Linux versions, see <a href="https://docs.aws.amazon.com/eks/latest/userguide/eks-linux-ami-versions.html">Amazon EKS optimized Amazon Linux AMI versions</a> in the <i>Amazon EKS User Guide</i>. Amazon EKS managed node groups support the November 2022 and later releases of the Windows AMIs. For information about Windows versions, see <a href="https://docs.aws.amazon.com/eks/latest/userguide/eks-ami-versions-windows.html">Amazon EKS optimized Windows AMI versions</a> in the <i>Amazon EKS User Guide</i>.</p>
171 /// <p>If you specify <code>launchTemplate</code>, and your launch template uses a custom AMI, then don't specify <code>releaseVersion</code>, or the node group update will fail. For more information about using launch templates with Amazon EKS, see <a href="https://docs.aws.amazon.com/eks/latest/userguide/launch-templates.html">Customizing managed nodes with launch templates</a> in the <i>Amazon EKS User Guide</i>.</p>
172 pub fn get_release_version(&self) -> &::std::option::Option<::std::string::String> {
173 self.inner.get_release_version()
174 }
175 /// <p>An object representing a node group's launch template specification. You can only update a node group using a launch template if the node group was originally deployed with a launch template. When updating, you must specify the same launch template ID or name that was used to create the node group.</p>
176 pub fn launch_template(mut self, input: crate::types::LaunchTemplateSpecification) -> Self {
177 self.inner = self.inner.launch_template(input);
178 self
179 }
180 /// <p>An object representing a node group's launch template specification. You can only update a node group using a launch template if the node group was originally deployed with a launch template. When updating, you must specify the same launch template ID or name that was used to create the node group.</p>
181 pub fn set_launch_template(mut self, input: ::std::option::Option<crate::types::LaunchTemplateSpecification>) -> Self {
182 self.inner = self.inner.set_launch_template(input);
183 self
184 }
185 /// <p>An object representing a node group's launch template specification. You can only update a node group using a launch template if the node group was originally deployed with a launch template. When updating, you must specify the same launch template ID or name that was used to create the node group.</p>
186 pub fn get_launch_template(&self) -> &::std::option::Option<crate::types::LaunchTemplateSpecification> {
187 self.inner.get_launch_template()
188 }
189 /// <p>Force the update if any <code>Pod</code> on the existing node group can't be drained due to a <code>Pod</code> disruption budget issue. If an update fails because all Pods can't be drained, you can force the update after it fails to terminate the old node whether or not any <code>Pod</code> is running on the node.</p>
190 pub fn force(mut self, input: bool) -> Self {
191 self.inner = self.inner.force(input);
192 self
193 }
194 /// <p>Force the update if any <code>Pod</code> on the existing node group can't be drained due to a <code>Pod</code> disruption budget issue. If an update fails because all Pods can't be drained, you can force the update after it fails to terminate the old node whether or not any <code>Pod</code> is running on the node.</p>
195 pub fn set_force(mut self, input: ::std::option::Option<bool>) -> Self {
196 self.inner = self.inner.set_force(input);
197 self
198 }
199 /// <p>Force the update if any <code>Pod</code> on the existing node group can't be drained due to a <code>Pod</code> disruption budget issue. If an update fails because all Pods can't be drained, you can force the update after it fails to terminate the old node whether or not any <code>Pod</code> is running on the node.</p>
200 pub fn get_force(&self) -> &::std::option::Option<bool> {
201 self.inner.get_force()
202 }
203 /// <p>A unique, case-sensitive identifier that you provide to ensure the idempotency of the request.</p>
204 pub fn client_request_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
205 self.inner = self.inner.client_request_token(input.into());
206 self
207 }
208 /// <p>A unique, case-sensitive identifier that you provide to ensure the idempotency of the request.</p>
209 pub fn set_client_request_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
210 self.inner = self.inner.set_client_request_token(input);
211 self
212 }
213 /// <p>A unique, case-sensitive identifier that you provide to ensure the idempotency of the request.</p>
214 pub fn get_client_request_token(&self) -> &::std::option::Option<::std::string::String> {
215 self.inner.get_client_request_token()
216 }
217}