aws_sdk_eks/operation/update_addon/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::update_addon::_update_addon_output::UpdateAddonOutputBuilder;
3
4pub use crate::operation::update_addon::_update_addon_input::UpdateAddonInputBuilder;
5
6impl crate::operation::update_addon::builders::UpdateAddonInputBuilder {
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_addon::UpdateAddonOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::update_addon::UpdateAddonError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.update_addon();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `UpdateAddon`.
24///
25/// <p>Updates an Amazon EKS add-on.</p>
26#[derive(::std::clone::Clone, ::std::fmt::Debug)]
27pub struct UpdateAddonFluentBuilder {
28    handle: ::std::sync::Arc<crate::client::Handle>,
29    inner: crate::operation::update_addon::builders::UpdateAddonInputBuilder,
30    config_override: ::std::option::Option<crate::config::Builder>,
31}
32impl
33    crate::client::customize::internal::CustomizableSend<
34        crate::operation::update_addon::UpdateAddonOutput,
35        crate::operation::update_addon::UpdateAddonError,
36    > for UpdateAddonFluentBuilder
37{
38    fn send(
39        self,
40        config_override: crate::config::Builder,
41    ) -> crate::client::customize::internal::BoxFuture<
42        crate::client::customize::internal::SendResult<
43            crate::operation::update_addon::UpdateAddonOutput,
44            crate::operation::update_addon::UpdateAddonError,
45        >,
46    > {
47        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
48    }
49}
50impl UpdateAddonFluentBuilder {
51    /// Creates a new `UpdateAddonFluentBuilder`.
52    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
53        Self {
54            handle,
55            inner: ::std::default::Default::default(),
56            config_override: ::std::option::Option::None,
57        }
58    }
59    /// Access the UpdateAddon as a reference.
60    pub fn as_input(&self) -> &crate::operation::update_addon::builders::UpdateAddonInputBuilder {
61        &self.inner
62    }
63    /// Sends the request and returns the response.
64    ///
65    /// If an error occurs, an `SdkError` will be returned with additional details that
66    /// can be matched against.
67    ///
68    /// By default, any retryable failures will be retried twice. Retry behavior
69    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
70    /// set when configuring the client.
71    pub async fn send(
72        self,
73    ) -> ::std::result::Result<
74        crate::operation::update_addon::UpdateAddonOutput,
75        ::aws_smithy_runtime_api::client::result::SdkError<
76            crate::operation::update_addon::UpdateAddonError,
77            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
78        >,
79    > {
80        let input = self
81            .inner
82            .build()
83            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
84        let runtime_plugins = crate::operation::update_addon::UpdateAddon::operation_runtime_plugins(
85            self.handle.runtime_plugins.clone(),
86            &self.handle.conf,
87            self.config_override,
88        );
89        crate::operation::update_addon::UpdateAddon::orchestrate(&runtime_plugins, input).await
90    }
91
92    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
93    pub fn customize(
94        self,
95    ) -> crate::client::customize::CustomizableOperation<
96        crate::operation::update_addon::UpdateAddonOutput,
97        crate::operation::update_addon::UpdateAddonError,
98        Self,
99    > {
100        crate::client::customize::CustomizableOperation::new(self)
101    }
102    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
103        self.set_config_override(::std::option::Option::Some(config_override.into()));
104        self
105    }
106
107    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
108        self.config_override = config_override;
109        self
110    }
111    /// <p>The name of your cluster.</p>
112    pub fn cluster_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
113        self.inner = self.inner.cluster_name(input.into());
114        self
115    }
116    /// <p>The name of your cluster.</p>
117    pub fn set_cluster_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
118        self.inner = self.inner.set_cluster_name(input);
119        self
120    }
121    /// <p>The name of your cluster.</p>
122    pub fn get_cluster_name(&self) -> &::std::option::Option<::std::string::String> {
123        self.inner.get_cluster_name()
124    }
125    /// <p>The name of the add-on. The name must match one of the names returned by <a href="https://docs.aws.amazon.com/eks/latest/APIReference/API_ListAddons.html"> <code>ListAddons</code> </a>.</p>
126    pub fn addon_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
127        self.inner = self.inner.addon_name(input.into());
128        self
129    }
130    /// <p>The name of the add-on. The name must match one of the names returned by <a href="https://docs.aws.amazon.com/eks/latest/APIReference/API_ListAddons.html"> <code>ListAddons</code> </a>.</p>
131    pub fn set_addon_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
132        self.inner = self.inner.set_addon_name(input);
133        self
134    }
135    /// <p>The name of the add-on. The name must match one of the names returned by <a href="https://docs.aws.amazon.com/eks/latest/APIReference/API_ListAddons.html"> <code>ListAddons</code> </a>.</p>
136    pub fn get_addon_name(&self) -> &::std::option::Option<::std::string::String> {
137        self.inner.get_addon_name()
138    }
139    /// <p>The version of the add-on. The version must match one of the versions returned by <a href="https://docs.aws.amazon.com/eks/latest/APIReference/API_DescribeAddonVersions.html"> <code>DescribeAddonVersions</code> </a>.</p>
140    pub fn addon_version(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
141        self.inner = self.inner.addon_version(input.into());
142        self
143    }
144    /// <p>The version of the add-on. The version must match one of the versions returned by <a href="https://docs.aws.amazon.com/eks/latest/APIReference/API_DescribeAddonVersions.html"> <code>DescribeAddonVersions</code> </a>.</p>
145    pub fn set_addon_version(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
146        self.inner = self.inner.set_addon_version(input);
147        self
148    }
149    /// <p>The version of the add-on. The version must match one of the versions returned by <a href="https://docs.aws.amazon.com/eks/latest/APIReference/API_DescribeAddonVersions.html"> <code>DescribeAddonVersions</code> </a>.</p>
150    pub fn get_addon_version(&self) -> &::std::option::Option<::std::string::String> {
151        self.inner.get_addon_version()
152    }
153    /// <p>The Amazon Resource Name (ARN) of an existing IAM role to bind to the add-on's service account. The role must be assigned the IAM permissions required by the add-on. If you don't specify an existing IAM role, then the add-on uses the permissions assigned to the node IAM role. For more information, see <a href="https://docs.aws.amazon.com/eks/latest/userguide/create-node-role.html">Amazon EKS node IAM role</a> in the <i>Amazon EKS User Guide</i>.</p><note>
154    /// <p>To specify an existing IAM role, you must have an IAM OpenID Connect (OIDC) provider created for your cluster. For more information, see <a href="https://docs.aws.amazon.com/eks/latest/userguide/enable-iam-roles-for-service-accounts.html">Enabling IAM roles for service accounts on your cluster</a> in the <i>Amazon EKS User Guide</i>.</p>
155    /// </note>
156    pub fn service_account_role_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
157        self.inner = self.inner.service_account_role_arn(input.into());
158        self
159    }
160    /// <p>The Amazon Resource Name (ARN) of an existing IAM role to bind to the add-on's service account. The role must be assigned the IAM permissions required by the add-on. If you don't specify an existing IAM role, then the add-on uses the permissions assigned to the node IAM role. For more information, see <a href="https://docs.aws.amazon.com/eks/latest/userguide/create-node-role.html">Amazon EKS node IAM role</a> in the <i>Amazon EKS User Guide</i>.</p><note>
161    /// <p>To specify an existing IAM role, you must have an IAM OpenID Connect (OIDC) provider created for your cluster. For more information, see <a href="https://docs.aws.amazon.com/eks/latest/userguide/enable-iam-roles-for-service-accounts.html">Enabling IAM roles for service accounts on your cluster</a> in the <i>Amazon EKS User Guide</i>.</p>
162    /// </note>
163    pub fn set_service_account_role_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
164        self.inner = self.inner.set_service_account_role_arn(input);
165        self
166    }
167    /// <p>The Amazon Resource Name (ARN) of an existing IAM role to bind to the add-on's service account. The role must be assigned the IAM permissions required by the add-on. If you don't specify an existing IAM role, then the add-on uses the permissions assigned to the node IAM role. For more information, see <a href="https://docs.aws.amazon.com/eks/latest/userguide/create-node-role.html">Amazon EKS node IAM role</a> in the <i>Amazon EKS User Guide</i>.</p><note>
168    /// <p>To specify an existing IAM role, you must have an IAM OpenID Connect (OIDC) provider created for your cluster. For more information, see <a href="https://docs.aws.amazon.com/eks/latest/userguide/enable-iam-roles-for-service-accounts.html">Enabling IAM roles for service accounts on your cluster</a> in the <i>Amazon EKS User Guide</i>.</p>
169    /// </note>
170    pub fn get_service_account_role_arn(&self) -> &::std::option::Option<::std::string::String> {
171        self.inner.get_service_account_role_arn()
172    }
173    /// <p>How to resolve field value conflicts for an Amazon EKS add-on if you've changed a value from the Amazon EKS default value. Conflicts are handled based on the option you choose:</p>
174    /// <ul>
175    /// <li>
176    /// <p><b>None</b> – Amazon EKS doesn't change the value. The update might fail.</p></li>
177    /// <li>
178    /// <p><b>Overwrite</b> – Amazon EKS overwrites the changed value back to the Amazon EKS default value.</p></li>
179    /// <li>
180    /// <p><b>Preserve</b> – Amazon EKS preserves the value. If you choose this option, we recommend that you test any field and value changes on a non-production cluster before updating the add-on on your production cluster.</p></li>
181    /// </ul>
182    pub fn resolve_conflicts(mut self, input: crate::types::ResolveConflicts) -> Self {
183        self.inner = self.inner.resolve_conflicts(input);
184        self
185    }
186    /// <p>How to resolve field value conflicts for an Amazon EKS add-on if you've changed a value from the Amazon EKS default value. Conflicts are handled based on the option you choose:</p>
187    /// <ul>
188    /// <li>
189    /// <p><b>None</b> – Amazon EKS doesn't change the value. The update might fail.</p></li>
190    /// <li>
191    /// <p><b>Overwrite</b> – Amazon EKS overwrites the changed value back to the Amazon EKS default value.</p></li>
192    /// <li>
193    /// <p><b>Preserve</b> – Amazon EKS preserves the value. If you choose this option, we recommend that you test any field and value changes on a non-production cluster before updating the add-on on your production cluster.</p></li>
194    /// </ul>
195    pub fn set_resolve_conflicts(mut self, input: ::std::option::Option<crate::types::ResolveConflicts>) -> Self {
196        self.inner = self.inner.set_resolve_conflicts(input);
197        self
198    }
199    /// <p>How to resolve field value conflicts for an Amazon EKS add-on if you've changed a value from the Amazon EKS default value. Conflicts are handled based on the option you choose:</p>
200    /// <ul>
201    /// <li>
202    /// <p><b>None</b> – Amazon EKS doesn't change the value. The update might fail.</p></li>
203    /// <li>
204    /// <p><b>Overwrite</b> – Amazon EKS overwrites the changed value back to the Amazon EKS default value.</p></li>
205    /// <li>
206    /// <p><b>Preserve</b> – Amazon EKS preserves the value. If you choose this option, we recommend that you test any field and value changes on a non-production cluster before updating the add-on on your production cluster.</p></li>
207    /// </ul>
208    pub fn get_resolve_conflicts(&self) -> &::std::option::Option<crate::types::ResolveConflicts> {
209        self.inner.get_resolve_conflicts()
210    }
211    /// <p>A unique, case-sensitive identifier that you provide to ensure the idempotency of the request.</p>
212    pub fn client_request_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
213        self.inner = self.inner.client_request_token(input.into());
214        self
215    }
216    /// <p>A unique, case-sensitive identifier that you provide to ensure the idempotency of the request.</p>
217    pub fn set_client_request_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
218        self.inner = self.inner.set_client_request_token(input);
219        self
220    }
221    /// <p>A unique, case-sensitive identifier that you provide to ensure the idempotency of the request.</p>
222    pub fn get_client_request_token(&self) -> &::std::option::Option<::std::string::String> {
223        self.inner.get_client_request_token()
224    }
225    /// <p>The set of configuration values for the add-on that's created. The values that you provide are validated against the schema returned by <code>DescribeAddonConfiguration</code>.</p>
226    pub fn configuration_values(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
227        self.inner = self.inner.configuration_values(input.into());
228        self
229    }
230    /// <p>The set of configuration values for the add-on that's created. The values that you provide are validated against the schema returned by <code>DescribeAddonConfiguration</code>.</p>
231    pub fn set_configuration_values(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
232        self.inner = self.inner.set_configuration_values(input);
233        self
234    }
235    /// <p>The set of configuration values for the add-on that's created. The values that you provide are validated against the schema returned by <code>DescribeAddonConfiguration</code>.</p>
236    pub fn get_configuration_values(&self) -> &::std::option::Option<::std::string::String> {
237        self.inner.get_configuration_values()
238    }
239    ///
240    /// Appends an item to `podIdentityAssociations`.
241    ///
242    /// To override the contents of this collection use [`set_pod_identity_associations`](Self::set_pod_identity_associations).
243    ///
244    /// <p>An array of EKS Pod Identity associations to be updated. Each association maps a Kubernetes service account to an IAM role. If this value is left blank, no change. If an empty array is provided, existing associations owned by the add-on are deleted.</p>
245    /// <p>For more information, see <a href="https://docs.aws.amazon.com/eks/latest/userguide/add-ons-iam.html">Attach an IAM Role to an Amazon EKS add-on using EKS Pod Identity</a> in the <i>Amazon EKS User Guide</i>.</p>
246    pub fn pod_identity_associations(mut self, input: crate::types::AddonPodIdentityAssociations) -> Self {
247        self.inner = self.inner.pod_identity_associations(input);
248        self
249    }
250    /// <p>An array of EKS Pod Identity associations to be updated. Each association maps a Kubernetes service account to an IAM role. If this value is left blank, no change. If an empty array is provided, existing associations owned by the add-on are deleted.</p>
251    /// <p>For more information, see <a href="https://docs.aws.amazon.com/eks/latest/userguide/add-ons-iam.html">Attach an IAM Role to an Amazon EKS add-on using EKS Pod Identity</a> in the <i>Amazon EKS User Guide</i>.</p>
252    pub fn set_pod_identity_associations(
253        mut self,
254        input: ::std::option::Option<::std::vec::Vec<crate::types::AddonPodIdentityAssociations>>,
255    ) -> Self {
256        self.inner = self.inner.set_pod_identity_associations(input);
257        self
258    }
259    /// <p>An array of EKS Pod Identity associations to be updated. Each association maps a Kubernetes service account to an IAM role. If this value is left blank, no change. If an empty array is provided, existing associations owned by the add-on are deleted.</p>
260    /// <p>For more information, see <a href="https://docs.aws.amazon.com/eks/latest/userguide/add-ons-iam.html">Attach an IAM Role to an Amazon EKS add-on using EKS Pod Identity</a> in the <i>Amazon EKS User Guide</i>.</p>
261    pub fn get_pod_identity_associations(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::AddonPodIdentityAssociations>> {
262        self.inner.get_pod_identity_associations()
263    }
264}