aws_sdk_eks/operation/create_addon/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::create_addon::_create_addon_output::CreateAddonOutputBuilder;
3
4pub use crate::operation::create_addon::_create_addon_input::CreateAddonInputBuilder;
5
6impl crate::operation::create_addon::builders::CreateAddonInputBuilder {
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::create_addon::CreateAddonOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::create_addon::CreateAddonError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.create_addon();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `CreateAddon`.
24///
25/// <p>Creates an Amazon EKS add-on.</p>
26/// <p>Amazon EKS add-ons help to automate the provisioning and lifecycle management of common operational software for Amazon EKS clusters. For more information, see <a href="https://docs.aws.amazon.com/eks/latest/userguide/eks-add-ons.html">Amazon EKS add-ons</a> in the <i>Amazon EKS User Guide</i>.</p>
27#[derive(::std::clone::Clone, ::std::fmt::Debug)]
28pub struct CreateAddonFluentBuilder {
29    handle: ::std::sync::Arc<crate::client::Handle>,
30    inner: crate::operation::create_addon::builders::CreateAddonInputBuilder,
31    config_override: ::std::option::Option<crate::config::Builder>,
32}
33impl
34    crate::client::customize::internal::CustomizableSend<
35        crate::operation::create_addon::CreateAddonOutput,
36        crate::operation::create_addon::CreateAddonError,
37    > for CreateAddonFluentBuilder
38{
39    fn send(
40        self,
41        config_override: crate::config::Builder,
42    ) -> crate::client::customize::internal::BoxFuture<
43        crate::client::customize::internal::SendResult<
44            crate::operation::create_addon::CreateAddonOutput,
45            crate::operation::create_addon::CreateAddonError,
46        >,
47    > {
48        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
49    }
50}
51impl CreateAddonFluentBuilder {
52    /// Creates a new `CreateAddonFluentBuilder`.
53    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
54        Self {
55            handle,
56            inner: ::std::default::Default::default(),
57            config_override: ::std::option::Option::None,
58        }
59    }
60    /// Access the CreateAddon as a reference.
61    pub fn as_input(&self) -> &crate::operation::create_addon::builders::CreateAddonInputBuilder {
62        &self.inner
63    }
64    /// Sends the request and returns the response.
65    ///
66    /// If an error occurs, an `SdkError` will be returned with additional details that
67    /// can be matched against.
68    ///
69    /// By default, any retryable failures will be retried twice. Retry behavior
70    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
71    /// set when configuring the client.
72    pub async fn send(
73        self,
74    ) -> ::std::result::Result<
75        crate::operation::create_addon::CreateAddonOutput,
76        ::aws_smithy_runtime_api::client::result::SdkError<
77            crate::operation::create_addon::CreateAddonError,
78            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
79        >,
80    > {
81        let input = self
82            .inner
83            .build()
84            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
85        let runtime_plugins = crate::operation::create_addon::CreateAddon::operation_runtime_plugins(
86            self.handle.runtime_plugins.clone(),
87            &self.handle.conf,
88            self.config_override,
89        );
90        crate::operation::create_addon::CreateAddon::orchestrate(&runtime_plugins, input).await
91    }
92
93    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
94    pub fn customize(
95        self,
96    ) -> crate::client::customize::CustomizableOperation<
97        crate::operation::create_addon::CreateAddonOutput,
98        crate::operation::create_addon::CreateAddonError,
99        Self,
100    > {
101        crate::client::customize::CustomizableOperation::new(self)
102    }
103    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
104        self.set_config_override(::std::option::Option::Some(config_override.into()));
105        self
106    }
107
108    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
109        self.config_override = config_override;
110        self
111    }
112    /// <p>The name of your cluster.</p>
113    pub fn cluster_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
114        self.inner = self.inner.cluster_name(input.into());
115        self
116    }
117    /// <p>The name of your cluster.</p>
118    pub fn set_cluster_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
119        self.inner = self.inner.set_cluster_name(input);
120        self
121    }
122    /// <p>The name of your cluster.</p>
123    pub fn get_cluster_name(&self) -> &::std::option::Option<::std::string::String> {
124        self.inner.get_cluster_name()
125    }
126    /// <p>The name of the add-on. The name must match one of the names returned by <code>DescribeAddonVersions</code>.</p>
127    pub fn addon_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
128        self.inner = self.inner.addon_name(input.into());
129        self
130    }
131    /// <p>The name of the add-on. The name must match one of the names returned by <code>DescribeAddonVersions</code>.</p>
132    pub fn set_addon_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
133        self.inner = self.inner.set_addon_name(input);
134        self
135    }
136    /// <p>The name of the add-on. The name must match one of the names returned by <code>DescribeAddonVersions</code>.</p>
137    pub fn get_addon_name(&self) -> &::std::option::Option<::std::string::String> {
138        self.inner.get_addon_name()
139    }
140    /// <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>
141    pub fn addon_version(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
142        self.inner = self.inner.addon_version(input.into());
143        self
144    }
145    /// <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>
146    pub fn set_addon_version(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
147        self.inner = self.inner.set_addon_version(input);
148        self
149    }
150    /// <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>
151    pub fn get_addon_version(&self) -> &::std::option::Option<::std::string::String> {
152        self.inner.get_addon_version()
153    }
154    /// <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>
155    /// <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>
156    /// </note>
157    pub fn service_account_role_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
158        self.inner = self.inner.service_account_role_arn(input.into());
159        self
160    }
161    /// <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>
162    /// <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>
163    /// </note>
164    pub fn set_service_account_role_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
165        self.inner = self.inner.set_service_account_role_arn(input);
166        self
167    }
168    /// <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>
169    /// <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>
170    /// </note>
171    pub fn get_service_account_role_arn(&self) -> &::std::option::Option<::std::string::String> {
172        self.inner.get_service_account_role_arn()
173    }
174    /// <p>How to resolve field value conflicts for an Amazon EKS add-on. Conflicts are handled based on the value you choose:</p>
175    /// <ul>
176    /// <li>
177    /// <p><b>None</b> – If the self-managed version of the add-on is installed on your cluster, Amazon EKS doesn't change the value. Creation of the add-on might fail.</p></li>
178    /// <li>
179    /// <p><b>Overwrite</b> – If the self-managed version of the add-on is installed on your cluster and the Amazon EKS default value is different than the existing value, Amazon EKS changes the value to the Amazon EKS default value.</p></li>
180    /// <li>
181    /// <p><b>Preserve</b> – This is similar to the NONE option. If the self-managed version of the add-on is installed on your cluster Amazon EKS doesn't change the add-on resource properties. Creation of the add-on might fail if conflicts are detected. This option works differently during the update operation. For more information, see <a href="https://docs.aws.amazon.com/eks/latest/APIReference/API_UpdateAddon.html"> <code>UpdateAddon</code> </a>.</p></li>
182    /// </ul>
183    /// <p>If you don't currently have the self-managed version of the add-on installed on your cluster, the Amazon EKS add-on is installed. Amazon EKS sets all values to default values, regardless of the option that you specify.</p>
184    pub fn resolve_conflicts(mut self, input: crate::types::ResolveConflicts) -> Self {
185        self.inner = self.inner.resolve_conflicts(input);
186        self
187    }
188    /// <p>How to resolve field value conflicts for an Amazon EKS add-on. Conflicts are handled based on the value you choose:</p>
189    /// <ul>
190    /// <li>
191    /// <p><b>None</b> – If the self-managed version of the add-on is installed on your cluster, Amazon EKS doesn't change the value. Creation of the add-on might fail.</p></li>
192    /// <li>
193    /// <p><b>Overwrite</b> – If the self-managed version of the add-on is installed on your cluster and the Amazon EKS default value is different than the existing value, Amazon EKS changes the value to the Amazon EKS default value.</p></li>
194    /// <li>
195    /// <p><b>Preserve</b> – This is similar to the NONE option. If the self-managed version of the add-on is installed on your cluster Amazon EKS doesn't change the add-on resource properties. Creation of the add-on might fail if conflicts are detected. This option works differently during the update operation. For more information, see <a href="https://docs.aws.amazon.com/eks/latest/APIReference/API_UpdateAddon.html"> <code>UpdateAddon</code> </a>.</p></li>
196    /// </ul>
197    /// <p>If you don't currently have the self-managed version of the add-on installed on your cluster, the Amazon EKS add-on is installed. Amazon EKS sets all values to default values, regardless of the option that you specify.</p>
198    pub fn set_resolve_conflicts(mut self, input: ::std::option::Option<crate::types::ResolveConflicts>) -> Self {
199        self.inner = self.inner.set_resolve_conflicts(input);
200        self
201    }
202    /// <p>How to resolve field value conflicts for an Amazon EKS add-on. Conflicts are handled based on the value you choose:</p>
203    /// <ul>
204    /// <li>
205    /// <p><b>None</b> – If the self-managed version of the add-on is installed on your cluster, Amazon EKS doesn't change the value. Creation of the add-on might fail.</p></li>
206    /// <li>
207    /// <p><b>Overwrite</b> – If the self-managed version of the add-on is installed on your cluster and the Amazon EKS default value is different than the existing value, Amazon EKS changes the value to the Amazon EKS default value.</p></li>
208    /// <li>
209    /// <p><b>Preserve</b> – This is similar to the NONE option. If the self-managed version of the add-on is installed on your cluster Amazon EKS doesn't change the add-on resource properties. Creation of the add-on might fail if conflicts are detected. This option works differently during the update operation. For more information, see <a href="https://docs.aws.amazon.com/eks/latest/APIReference/API_UpdateAddon.html"> <code>UpdateAddon</code> </a>.</p></li>
210    /// </ul>
211    /// <p>If you don't currently have the self-managed version of the add-on installed on your cluster, the Amazon EKS add-on is installed. Amazon EKS sets all values to default values, regardless of the option that you specify.</p>
212    pub fn get_resolve_conflicts(&self) -> &::std::option::Option<crate::types::ResolveConflicts> {
213        self.inner.get_resolve_conflicts()
214    }
215    /// <p>A unique, case-sensitive identifier that you provide to ensure the idempotency of the request.</p>
216    pub fn client_request_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
217        self.inner = self.inner.client_request_token(input.into());
218        self
219    }
220    /// <p>A unique, case-sensitive identifier that you provide to ensure the idempotency of the request.</p>
221    pub fn set_client_request_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
222        self.inner = self.inner.set_client_request_token(input);
223        self
224    }
225    /// <p>A unique, case-sensitive identifier that you provide to ensure the idempotency of the request.</p>
226    pub fn get_client_request_token(&self) -> &::std::option::Option<::std::string::String> {
227        self.inner.get_client_request_token()
228    }
229    ///
230    /// Adds a key-value pair to `tags`.
231    ///
232    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
233    ///
234    /// <p>Metadata that assists with categorization and organization. Each tag consists of a key and an optional value. You define both. Tags don't propagate to any other cluster or Amazon Web Services resources.</p>
235    pub fn tags(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
236        self.inner = self.inner.tags(k.into(), v.into());
237        self
238    }
239    /// <p>Metadata that assists with categorization and organization. Each tag consists of a key and an optional value. You define both. Tags don't propagate to any other cluster or Amazon Web Services resources.</p>
240    pub fn set_tags(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
241        self.inner = self.inner.set_tags(input);
242        self
243    }
244    /// <p>Metadata that assists with categorization and organization. Each tag consists of a key and an optional value. You define both. Tags don't propagate to any other cluster or Amazon Web Services resources.</p>
245    pub fn get_tags(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
246        self.inner.get_tags()
247    }
248    /// <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>
249    pub fn configuration_values(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
250        self.inner = self.inner.configuration_values(input.into());
251        self
252    }
253    /// <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>
254    pub fn set_configuration_values(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
255        self.inner = self.inner.set_configuration_values(input);
256        self
257    }
258    /// <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>
259    pub fn get_configuration_values(&self) -> &::std::option::Option<::std::string::String> {
260        self.inner.get_configuration_values()
261    }
262    ///
263    /// Appends an item to `podIdentityAssociations`.
264    ///
265    /// To override the contents of this collection use [`set_pod_identity_associations`](Self::set_pod_identity_associations).
266    ///
267    /// <p>An array of EKS Pod Identity associations to be created. Each association maps a Kubernetes service account to an IAM role.</p>
268    /// <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>
269    pub fn pod_identity_associations(mut self, input: crate::types::AddonPodIdentityAssociations) -> Self {
270        self.inner = self.inner.pod_identity_associations(input);
271        self
272    }
273    /// <p>An array of EKS Pod Identity associations to be created. Each association maps a Kubernetes service account to an IAM role.</p>
274    /// <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>
275    pub fn set_pod_identity_associations(
276        mut self,
277        input: ::std::option::Option<::std::vec::Vec<crate::types::AddonPodIdentityAssociations>>,
278    ) -> Self {
279        self.inner = self.inner.set_pod_identity_associations(input);
280        self
281    }
282    /// <p>An array of EKS Pod Identity associations to be created. Each association maps a Kubernetes service account to an IAM role.</p>
283    /// <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>
284    pub fn get_pod_identity_associations(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::AddonPodIdentityAssociations>> {
285        self.inner.get_pod_identity_associations()
286    }
287    /// <p>The namespace configuration for the addon. If specified, this will override the default namespace for the addon.</p>
288    pub fn namespace_config(mut self, input: crate::types::AddonNamespaceConfigRequest) -> Self {
289        self.inner = self.inner.namespace_config(input);
290        self
291    }
292    /// <p>The namespace configuration for the addon. If specified, this will override the default namespace for the addon.</p>
293    pub fn set_namespace_config(mut self, input: ::std::option::Option<crate::types::AddonNamespaceConfigRequest>) -> Self {
294        self.inner = self.inner.set_namespace_config(input);
295        self
296    }
297    /// <p>The namespace configuration for the addon. If specified, this will override the default namespace for the addon.</p>
298    pub fn get_namespace_config(&self) -> &::std::option::Option<crate::types::AddonNamespaceConfigRequest> {
299        self.inner.get_namespace_config()
300    }
301}