aws_sdk_eks/operation/update_addon/
_update_addon_input.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2#[allow(missing_docs)] // documentation missing in model
3#[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
5pub struct UpdateAddonInput {
6    /// <p>The name of your cluster.</p>
7    pub cluster_name: ::std::option::Option<::std::string::String>,
8    /// <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>
9    pub addon_name: ::std::option::Option<::std::string::String>,
10    /// <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>
11    pub addon_version: ::std::option::Option<::std::string::String>,
12    /// <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>
13    /// <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>
14    /// </note>
15    pub service_account_role_arn: ::std::option::Option<::std::string::String>,
16    /// <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>
17    /// <ul>
18    /// <li>
19    /// <p><b>None</b> – Amazon EKS doesn't change the value. The update might fail.</p></li>
20    /// <li>
21    /// <p><b>Overwrite</b> – Amazon EKS overwrites the changed value back to the Amazon EKS default value.</p></li>
22    /// <li>
23    /// <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>
24    /// </ul>
25    pub resolve_conflicts: ::std::option::Option<crate::types::ResolveConflicts>,
26    /// <p>A unique, case-sensitive identifier that you provide to ensure the idempotency of the request.</p>
27    pub client_request_token: ::std::option::Option<::std::string::String>,
28    /// <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>
29    pub configuration_values: ::std::option::Option<::std::string::String>,
30    /// <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>
31    /// <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>
32    pub pod_identity_associations: ::std::option::Option<::std::vec::Vec<crate::types::AddonPodIdentityAssociations>>,
33}
34impl UpdateAddonInput {
35    /// <p>The name of your cluster.</p>
36    pub fn cluster_name(&self) -> ::std::option::Option<&str> {
37        self.cluster_name.as_deref()
38    }
39    /// <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>
40    pub fn addon_name(&self) -> ::std::option::Option<&str> {
41        self.addon_name.as_deref()
42    }
43    /// <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>
44    pub fn addon_version(&self) -> ::std::option::Option<&str> {
45        self.addon_version.as_deref()
46    }
47    /// <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>
48    /// <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>
49    /// </note>
50    pub fn service_account_role_arn(&self) -> ::std::option::Option<&str> {
51        self.service_account_role_arn.as_deref()
52    }
53    /// <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>
54    /// <ul>
55    /// <li>
56    /// <p><b>None</b> – Amazon EKS doesn't change the value. The update might fail.</p></li>
57    /// <li>
58    /// <p><b>Overwrite</b> – Amazon EKS overwrites the changed value back to the Amazon EKS default value.</p></li>
59    /// <li>
60    /// <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>
61    /// </ul>
62    pub fn resolve_conflicts(&self) -> ::std::option::Option<&crate::types::ResolveConflicts> {
63        self.resolve_conflicts.as_ref()
64    }
65    /// <p>A unique, case-sensitive identifier that you provide to ensure the idempotency of the request.</p>
66    pub fn client_request_token(&self) -> ::std::option::Option<&str> {
67        self.client_request_token.as_deref()
68    }
69    /// <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>
70    pub fn configuration_values(&self) -> ::std::option::Option<&str> {
71        self.configuration_values.as_deref()
72    }
73    /// <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>
74    /// <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>
75    ///
76    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.pod_identity_associations.is_none()`.
77    pub fn pod_identity_associations(&self) -> &[crate::types::AddonPodIdentityAssociations] {
78        self.pod_identity_associations.as_deref().unwrap_or_default()
79    }
80}
81impl UpdateAddonInput {
82    /// Creates a new builder-style object to manufacture [`UpdateAddonInput`](crate::operation::update_addon::UpdateAddonInput).
83    pub fn builder() -> crate::operation::update_addon::builders::UpdateAddonInputBuilder {
84        crate::operation::update_addon::builders::UpdateAddonInputBuilder::default()
85    }
86}
87
88/// A builder for [`UpdateAddonInput`](crate::operation::update_addon::UpdateAddonInput).
89#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
90#[non_exhaustive]
91pub struct UpdateAddonInputBuilder {
92    pub(crate) cluster_name: ::std::option::Option<::std::string::String>,
93    pub(crate) addon_name: ::std::option::Option<::std::string::String>,
94    pub(crate) addon_version: ::std::option::Option<::std::string::String>,
95    pub(crate) service_account_role_arn: ::std::option::Option<::std::string::String>,
96    pub(crate) resolve_conflicts: ::std::option::Option<crate::types::ResolveConflicts>,
97    pub(crate) client_request_token: ::std::option::Option<::std::string::String>,
98    pub(crate) configuration_values: ::std::option::Option<::std::string::String>,
99    pub(crate) pod_identity_associations: ::std::option::Option<::std::vec::Vec<crate::types::AddonPodIdentityAssociations>>,
100}
101impl UpdateAddonInputBuilder {
102    /// <p>The name of your cluster.</p>
103    /// This field is required.
104    pub fn cluster_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
105        self.cluster_name = ::std::option::Option::Some(input.into());
106        self
107    }
108    /// <p>The name of your cluster.</p>
109    pub fn set_cluster_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
110        self.cluster_name = input;
111        self
112    }
113    /// <p>The name of your cluster.</p>
114    pub fn get_cluster_name(&self) -> &::std::option::Option<::std::string::String> {
115        &self.cluster_name
116    }
117    /// <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>
118    /// This field is required.
119    pub fn addon_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
120        self.addon_name = ::std::option::Option::Some(input.into());
121        self
122    }
123    /// <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>
124    pub fn set_addon_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
125        self.addon_name = input;
126        self
127    }
128    /// <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>
129    pub fn get_addon_name(&self) -> &::std::option::Option<::std::string::String> {
130        &self.addon_name
131    }
132    /// <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>
133    pub fn addon_version(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
134        self.addon_version = ::std::option::Option::Some(input.into());
135        self
136    }
137    /// <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>
138    pub fn set_addon_version(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
139        self.addon_version = input;
140        self
141    }
142    /// <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>
143    pub fn get_addon_version(&self) -> &::std::option::Option<::std::string::String> {
144        &self.addon_version
145    }
146    /// <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>
147    /// <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>
148    /// </note>
149    pub fn service_account_role_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
150        self.service_account_role_arn = ::std::option::Option::Some(input.into());
151        self
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 set_service_account_role_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
157        self.service_account_role_arn = input;
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 get_service_account_role_arn(&self) -> &::std::option::Option<::std::string::String> {
164        &self.service_account_role_arn
165    }
166    /// <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>
167    /// <ul>
168    /// <li>
169    /// <p><b>None</b> – Amazon EKS doesn't change the value. The update might fail.</p></li>
170    /// <li>
171    /// <p><b>Overwrite</b> – Amazon EKS overwrites the changed value back to the Amazon EKS default value.</p></li>
172    /// <li>
173    /// <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>
174    /// </ul>
175    pub fn resolve_conflicts(mut self, input: crate::types::ResolveConflicts) -> Self {
176        self.resolve_conflicts = ::std::option::Option::Some(input);
177        self
178    }
179    /// <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>
180    /// <ul>
181    /// <li>
182    /// <p><b>None</b> – Amazon EKS doesn't change the value. The update might fail.</p></li>
183    /// <li>
184    /// <p><b>Overwrite</b> – Amazon EKS overwrites the changed value back to the Amazon EKS default value.</p></li>
185    /// <li>
186    /// <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>
187    /// </ul>
188    pub fn set_resolve_conflicts(mut self, input: ::std::option::Option<crate::types::ResolveConflicts>) -> Self {
189        self.resolve_conflicts = input;
190        self
191    }
192    /// <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>
193    /// <ul>
194    /// <li>
195    /// <p><b>None</b> – Amazon EKS doesn't change the value. The update might fail.</p></li>
196    /// <li>
197    /// <p><b>Overwrite</b> – Amazon EKS overwrites the changed value back to the Amazon EKS default value.</p></li>
198    /// <li>
199    /// <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>
200    /// </ul>
201    pub fn get_resolve_conflicts(&self) -> &::std::option::Option<crate::types::ResolveConflicts> {
202        &self.resolve_conflicts
203    }
204    /// <p>A unique, case-sensitive identifier that you provide to ensure the idempotency of the request.</p>
205    pub fn client_request_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
206        self.client_request_token = ::std::option::Option::Some(input.into());
207        self
208    }
209    /// <p>A unique, case-sensitive identifier that you provide to ensure the idempotency of the request.</p>
210    pub fn set_client_request_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
211        self.client_request_token = input;
212        self
213    }
214    /// <p>A unique, case-sensitive identifier that you provide to ensure the idempotency of the request.</p>
215    pub fn get_client_request_token(&self) -> &::std::option::Option<::std::string::String> {
216        &self.client_request_token
217    }
218    /// <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>
219    pub fn configuration_values(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
220        self.configuration_values = ::std::option::Option::Some(input.into());
221        self
222    }
223    /// <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>
224    pub fn set_configuration_values(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
225        self.configuration_values = input;
226        self
227    }
228    /// <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>
229    pub fn get_configuration_values(&self) -> &::std::option::Option<::std::string::String> {
230        &self.configuration_values
231    }
232    /// Appends an item to `pod_identity_associations`.
233    ///
234    /// To override the contents of this collection use [`set_pod_identity_associations`](Self::set_pod_identity_associations).
235    ///
236    /// <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>
237    /// <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>
238    pub fn pod_identity_associations(mut self, input: crate::types::AddonPodIdentityAssociations) -> Self {
239        let mut v = self.pod_identity_associations.unwrap_or_default();
240        v.push(input);
241        self.pod_identity_associations = ::std::option::Option::Some(v);
242        self
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 set_pod_identity_associations(
247        mut self,
248        input: ::std::option::Option<::std::vec::Vec<crate::types::AddonPodIdentityAssociations>>,
249    ) -> Self {
250        self.pod_identity_associations = input;
251        self
252    }
253    /// <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>
254    /// <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>
255    pub fn get_pod_identity_associations(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::AddonPodIdentityAssociations>> {
256        &self.pod_identity_associations
257    }
258    /// Consumes the builder and constructs a [`UpdateAddonInput`](crate::operation::update_addon::UpdateAddonInput).
259    pub fn build(self) -> ::std::result::Result<crate::operation::update_addon::UpdateAddonInput, ::aws_smithy_types::error::operation::BuildError> {
260        ::std::result::Result::Ok(crate::operation::update_addon::UpdateAddonInput {
261            cluster_name: self.cluster_name,
262            addon_name: self.addon_name,
263            addon_version: self.addon_version,
264            service_account_role_arn: self.service_account_role_arn,
265            resolve_conflicts: self.resolve_conflicts,
266            client_request_token: self.client_request_token,
267            configuration_values: self.configuration_values,
268            pod_identity_associations: self.pod_identity_associations,
269        })
270    }
271}