aws_sdk_eks/operation/create_capability/builders.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::create_capability::_create_capability_output::CreateCapabilityOutputBuilder;
3
4pub use crate::operation::create_capability::_create_capability_input::CreateCapabilityInputBuilder;
5
6impl crate::operation::create_capability::builders::CreateCapabilityInputBuilder {
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_capability::CreateCapabilityOutput,
13 ::aws_smithy_runtime_api::client::result::SdkError<
14 crate::operation::create_capability::CreateCapabilityError,
15 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16 >,
17 > {
18 let mut fluent_builder = client.create_capability();
19 fluent_builder.inner = self;
20 fluent_builder.send().await
21 }
22}
23/// Fluent builder constructing a request to `CreateCapability`.
24///
25/// <p>Creates a managed capability resource for an Amazon EKS cluster.</p>
26/// <p>Capabilities provide fully managed capabilities to build and scale with Kubernetes. When you create a capability, Amazon EKSprovisions and manages the infrastructure required to run the capability outside of your cluster. This approach reduces operational overhead and preserves cluster resources.</p>
27/// <p>You can only create one Capability of each type on a given Amazon EKS cluster. Valid types are Argo CD for declarative GitOps deployment, Amazon Web Services Controllers for Kubernetes (ACK) for resource management, and Kube Resource Orchestrator (KRO) for Kubernetes custom resource orchestration.</p>
28/// <p>For more information, see <a href="https://docs.aws.amazon.com/eks/latest/userguide/capabilities.html">EKS Capabilities</a> in the <i>Amazon EKS User Guide</i>.</p>
29#[derive(::std::clone::Clone, ::std::fmt::Debug)]
30pub struct CreateCapabilityFluentBuilder {
31 handle: ::std::sync::Arc<crate::client::Handle>,
32 inner: crate::operation::create_capability::builders::CreateCapabilityInputBuilder,
33 config_override: ::std::option::Option<crate::config::Builder>,
34}
35impl
36 crate::client::customize::internal::CustomizableSend<
37 crate::operation::create_capability::CreateCapabilityOutput,
38 crate::operation::create_capability::CreateCapabilityError,
39 > for CreateCapabilityFluentBuilder
40{
41 fn send(
42 self,
43 config_override: crate::config::Builder,
44 ) -> crate::client::customize::internal::BoxFuture<
45 crate::client::customize::internal::SendResult<
46 crate::operation::create_capability::CreateCapabilityOutput,
47 crate::operation::create_capability::CreateCapabilityError,
48 >,
49 > {
50 ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
51 }
52}
53impl CreateCapabilityFluentBuilder {
54 /// Creates a new `CreateCapabilityFluentBuilder`.
55 pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
56 Self {
57 handle,
58 inner: ::std::default::Default::default(),
59 config_override: ::std::option::Option::None,
60 }
61 }
62 /// Access the CreateCapability as a reference.
63 pub fn as_input(&self) -> &crate::operation::create_capability::builders::CreateCapabilityInputBuilder {
64 &self.inner
65 }
66 /// Sends the request and returns the response.
67 ///
68 /// If an error occurs, an `SdkError` will be returned with additional details that
69 /// can be matched against.
70 ///
71 /// By default, any retryable failures will be retried twice. Retry behavior
72 /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
73 /// set when configuring the client.
74 pub async fn send(
75 self,
76 ) -> ::std::result::Result<
77 crate::operation::create_capability::CreateCapabilityOutput,
78 ::aws_smithy_runtime_api::client::result::SdkError<
79 crate::operation::create_capability::CreateCapabilityError,
80 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
81 >,
82 > {
83 let input = self
84 .inner
85 .build()
86 .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
87 let runtime_plugins = crate::operation::create_capability::CreateCapability::operation_runtime_plugins(
88 self.handle.runtime_plugins.clone(),
89 &self.handle.conf,
90 self.config_override,
91 );
92 crate::operation::create_capability::CreateCapability::orchestrate(&runtime_plugins, input).await
93 }
94
95 /// Consumes this builder, creating a customizable operation that can be modified before being sent.
96 pub fn customize(
97 self,
98 ) -> crate::client::customize::CustomizableOperation<
99 crate::operation::create_capability::CreateCapabilityOutput,
100 crate::operation::create_capability::CreateCapabilityError,
101 Self,
102 > {
103 crate::client::customize::CustomizableOperation::new(self)
104 }
105 pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
106 self.set_config_override(::std::option::Option::Some(config_override.into()));
107 self
108 }
109
110 pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
111 self.config_override = config_override;
112 self
113 }
114 /// <p>A unique name for the capability. The name must be unique within your cluster and can contain alphanumeric characters, hyphens, and underscores.</p>
115 pub fn capability_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
116 self.inner = self.inner.capability_name(input.into());
117 self
118 }
119 /// <p>A unique name for the capability. The name must be unique within your cluster and can contain alphanumeric characters, hyphens, and underscores.</p>
120 pub fn set_capability_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
121 self.inner = self.inner.set_capability_name(input);
122 self
123 }
124 /// <p>A unique name for the capability. The name must be unique within your cluster and can contain alphanumeric characters, hyphens, and underscores.</p>
125 pub fn get_capability_name(&self) -> &::std::option::Option<::std::string::String> {
126 self.inner.get_capability_name()
127 }
128 /// <p>The name of the Amazon EKS cluster where you want to create the capability.</p>
129 pub fn cluster_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
130 self.inner = self.inner.cluster_name(input.into());
131 self
132 }
133 /// <p>The name of the Amazon EKS cluster where you want to create the capability.</p>
134 pub fn set_cluster_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
135 self.inner = self.inner.set_cluster_name(input);
136 self
137 }
138 /// <p>The name of the Amazon EKS cluster where you want to create the capability.</p>
139 pub fn get_cluster_name(&self) -> &::std::option::Option<::std::string::String> {
140 self.inner.get_cluster_name()
141 }
142 /// <p>A unique, case-sensitive identifier that you provide to ensure the idempotency of the request. This token is valid for 24 hours after creation. If you retry a request with the same client request token and the same parameters after the original request has completed successfully, the result of the original request is returned.</p>
143 pub fn client_request_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
144 self.inner = self.inner.client_request_token(input.into());
145 self
146 }
147 /// <p>A unique, case-sensitive identifier that you provide to ensure the idempotency of the request. This token is valid for 24 hours after creation. If you retry a request with the same client request token and the same parameters after the original request has completed successfully, the result of the original request is returned.</p>
148 pub fn set_client_request_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
149 self.inner = self.inner.set_client_request_token(input);
150 self
151 }
152 /// <p>A unique, case-sensitive identifier that you provide to ensure the idempotency of the request. This token is valid for 24 hours after creation. If you retry a request with the same client request token and the same parameters after the original request has completed successfully, the result of the original request is returned.</p>
153 pub fn get_client_request_token(&self) -> &::std::option::Option<::std::string::String> {
154 self.inner.get_client_request_token()
155 }
156 /// <p>The type of capability to create. Valid values are:</p>
157 /// <ul>
158 /// <li>
159 /// <p><code>ACK</code> – Amazon Web Services Controllers for Kubernetes (ACK), which lets you manage resources directly from Kubernetes.</p></li>
160 /// <li>
161 /// <p><code>ARGOCD</code> – Argo CD for GitOps-based continuous delivery.</p></li>
162 /// <li>
163 /// <p><code>KRO</code> – Kube Resource Orchestrator (KRO) for composing and managing custom Kubernetes resources.</p></li>
164 /// </ul>
165 pub fn r#type(mut self, input: crate::types::CapabilityType) -> Self {
166 self.inner = self.inner.r#type(input);
167 self
168 }
169 /// <p>The type of capability to create. Valid values are:</p>
170 /// <ul>
171 /// <li>
172 /// <p><code>ACK</code> – Amazon Web Services Controllers for Kubernetes (ACK), which lets you manage resources directly from Kubernetes.</p></li>
173 /// <li>
174 /// <p><code>ARGOCD</code> – Argo CD for GitOps-based continuous delivery.</p></li>
175 /// <li>
176 /// <p><code>KRO</code> – Kube Resource Orchestrator (KRO) for composing and managing custom Kubernetes resources.</p></li>
177 /// </ul>
178 pub fn set_type(mut self, input: ::std::option::Option<crate::types::CapabilityType>) -> Self {
179 self.inner = self.inner.set_type(input);
180 self
181 }
182 /// <p>The type of capability to create. Valid values are:</p>
183 /// <ul>
184 /// <li>
185 /// <p><code>ACK</code> – Amazon Web Services Controllers for Kubernetes (ACK), which lets you manage resources directly from Kubernetes.</p></li>
186 /// <li>
187 /// <p><code>ARGOCD</code> – Argo CD for GitOps-based continuous delivery.</p></li>
188 /// <li>
189 /// <p><code>KRO</code> – Kube Resource Orchestrator (KRO) for composing and managing custom Kubernetes resources.</p></li>
190 /// </ul>
191 pub fn get_type(&self) -> &::std::option::Option<crate::types::CapabilityType> {
192 self.inner.get_type()
193 }
194 /// <p>The Amazon Resource Name (ARN) of the IAM role that the capability uses to interact with Amazon Web Services services. This role must have a trust policy that allows the EKS service principal to assume it, and it must have the necessary permissions for the capability type you're creating.</p>
195 /// <p>For ACK capabilities, the role needs permissions to manage the resources you want to control through Kubernetes. For Argo CD capabilities, the role needs permissions to access Git repositories and Secrets Manager. For KRO capabilities, the role needs permissions based on the resources you'll be orchestrating.</p>
196 pub fn role_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
197 self.inner = self.inner.role_arn(input.into());
198 self
199 }
200 /// <p>The Amazon Resource Name (ARN) of the IAM role that the capability uses to interact with Amazon Web Services services. This role must have a trust policy that allows the EKS service principal to assume it, and it must have the necessary permissions for the capability type you're creating.</p>
201 /// <p>For ACK capabilities, the role needs permissions to manage the resources you want to control through Kubernetes. For Argo CD capabilities, the role needs permissions to access Git repositories and Secrets Manager. For KRO capabilities, the role needs permissions based on the resources you'll be orchestrating.</p>
202 pub fn set_role_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
203 self.inner = self.inner.set_role_arn(input);
204 self
205 }
206 /// <p>The Amazon Resource Name (ARN) of the IAM role that the capability uses to interact with Amazon Web Services services. This role must have a trust policy that allows the EKS service principal to assume it, and it must have the necessary permissions for the capability type you're creating.</p>
207 /// <p>For ACK capabilities, the role needs permissions to manage the resources you want to control through Kubernetes. For Argo CD capabilities, the role needs permissions to access Git repositories and Secrets Manager. For KRO capabilities, the role needs permissions based on the resources you'll be orchestrating.</p>
208 pub fn get_role_arn(&self) -> &::std::option::Option<::std::string::String> {
209 self.inner.get_role_arn()
210 }
211 /// <p>The configuration settings for the capability. The structure of this object varies depending on the capability type. For Argo CD capabilities, you can configure IAM Identity CenterIAM; Identity Center integration, RBAC role mappings, and network access settings.</p>
212 pub fn configuration(mut self, input: crate::types::CapabilityConfigurationRequest) -> Self {
213 self.inner = self.inner.configuration(input);
214 self
215 }
216 /// <p>The configuration settings for the capability. The structure of this object varies depending on the capability type. For Argo CD capabilities, you can configure IAM Identity CenterIAM; Identity Center integration, RBAC role mappings, and network access settings.</p>
217 pub fn set_configuration(mut self, input: ::std::option::Option<crate::types::CapabilityConfigurationRequest>) -> Self {
218 self.inner = self.inner.set_configuration(input);
219 self
220 }
221 /// <p>The configuration settings for the capability. The structure of this object varies depending on the capability type. For Argo CD capabilities, you can configure IAM Identity CenterIAM; Identity Center integration, RBAC role mappings, and network access settings.</p>
222 pub fn get_configuration(&self) -> &::std::option::Option<crate::types::CapabilityConfigurationRequest> {
223 self.inner.get_configuration()
224 }
225 ///
226 /// Adds a key-value pair to `tags`.
227 ///
228 /// To override the contents of this collection use [`set_tags`](Self::set_tags).
229 ///
230 /// <p>The metadata that you apply to a resource to help you categorize and organize them. Each tag consists of a key and an optional value. You define them.</p>
231 /// <p>The following basic restrictions apply to tags:</p>
232 /// <ul>
233 /// <li>
234 /// <p>Maximum number of tags per resource – 50</p></li>
235 /// <li>
236 /// <p>For each resource, each tag key must be unique, and each tag key can have only one value.</p></li>
237 /// <li>
238 /// <p>Maximum key length – 128 Unicode characters in UTF-8</p></li>
239 /// <li>
240 /// <p>Maximum value length – 256 Unicode characters in UTF-8</p></li>
241 /// <li>
242 /// <p>If your tagging schema is used across multiple services and resources, remember that other services may have restrictions on allowed characters. Generally allowed characters are: letters, numbers, and spaces representable in UTF-8, and the following characters: + - = . _ : / @.</p></li>
243 /// <li>
244 /// <p>Tag keys and values are case-sensitive.</p></li>
245 /// <li>
246 /// <p>Do not use <code>aws:</code>, <code>AWS:</code>, or any upper or lowercase combination of such as a prefix for either keys or values as it is reserved for Amazon Web Services use. You cannot edit or delete tag keys or values with this prefix. Tags with this prefix do not count against your tags per resource limit.</p></li>
247 /// </ul>
248 pub fn tags(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
249 self.inner = self.inner.tags(k.into(), v.into());
250 self
251 }
252 /// <p>The metadata that you apply to a resource to help you categorize and organize them. Each tag consists of a key and an optional value. You define them.</p>
253 /// <p>The following basic restrictions apply to tags:</p>
254 /// <ul>
255 /// <li>
256 /// <p>Maximum number of tags per resource – 50</p></li>
257 /// <li>
258 /// <p>For each resource, each tag key must be unique, and each tag key can have only one value.</p></li>
259 /// <li>
260 /// <p>Maximum key length – 128 Unicode characters in UTF-8</p></li>
261 /// <li>
262 /// <p>Maximum value length – 256 Unicode characters in UTF-8</p></li>
263 /// <li>
264 /// <p>If your tagging schema is used across multiple services and resources, remember that other services may have restrictions on allowed characters. Generally allowed characters are: letters, numbers, and spaces representable in UTF-8, and the following characters: + - = . _ : / @.</p></li>
265 /// <li>
266 /// <p>Tag keys and values are case-sensitive.</p></li>
267 /// <li>
268 /// <p>Do not use <code>aws:</code>, <code>AWS:</code>, or any upper or lowercase combination of such as a prefix for either keys or values as it is reserved for Amazon Web Services use. You cannot edit or delete tag keys or values with this prefix. Tags with this prefix do not count against your tags per resource limit.</p></li>
269 /// </ul>
270 pub fn set_tags(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
271 self.inner = self.inner.set_tags(input);
272 self
273 }
274 /// <p>The metadata that you apply to a resource to help you categorize and organize them. Each tag consists of a key and an optional value. You define them.</p>
275 /// <p>The following basic restrictions apply to tags:</p>
276 /// <ul>
277 /// <li>
278 /// <p>Maximum number of tags per resource – 50</p></li>
279 /// <li>
280 /// <p>For each resource, each tag key must be unique, and each tag key can have only one value.</p></li>
281 /// <li>
282 /// <p>Maximum key length – 128 Unicode characters in UTF-8</p></li>
283 /// <li>
284 /// <p>Maximum value length – 256 Unicode characters in UTF-8</p></li>
285 /// <li>
286 /// <p>If your tagging schema is used across multiple services and resources, remember that other services may have restrictions on allowed characters. Generally allowed characters are: letters, numbers, and spaces representable in UTF-8, and the following characters: + - = . _ : / @.</p></li>
287 /// <li>
288 /// <p>Tag keys and values are case-sensitive.</p></li>
289 /// <li>
290 /// <p>Do not use <code>aws:</code>, <code>AWS:</code>, or any upper or lowercase combination of such as a prefix for either keys or values as it is reserved for Amazon Web Services use. You cannot edit or delete tag keys or values with this prefix. Tags with this prefix do not count against your tags per resource limit.</p></li>
291 /// </ul>
292 pub fn get_tags(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
293 self.inner.get_tags()
294 }
295 /// <p>Specifies how Kubernetes resources managed by the capability should be handled when the capability is deleted. Currently, the only supported value is <code>RETAIN</code> which retains all Kubernetes resources managed by the capability when the capability is deleted.</p>
296 /// <p>Because resources are retained, all Kubernetes resources created by the capability should be deleted from the cluster before deleting the capability itself. After the capability is deleted, these resources become difficult to manage because the controller is no longer available.</p>
297 pub fn delete_propagation_policy(mut self, input: crate::types::CapabilityDeletePropagationPolicy) -> Self {
298 self.inner = self.inner.delete_propagation_policy(input);
299 self
300 }
301 /// <p>Specifies how Kubernetes resources managed by the capability should be handled when the capability is deleted. Currently, the only supported value is <code>RETAIN</code> which retains all Kubernetes resources managed by the capability when the capability is deleted.</p>
302 /// <p>Because resources are retained, all Kubernetes resources created by the capability should be deleted from the cluster before deleting the capability itself. After the capability is deleted, these resources become difficult to manage because the controller is no longer available.</p>
303 pub fn set_delete_propagation_policy(mut self, input: ::std::option::Option<crate::types::CapabilityDeletePropagationPolicy>) -> Self {
304 self.inner = self.inner.set_delete_propagation_policy(input);
305 self
306 }
307 /// <p>Specifies how Kubernetes resources managed by the capability should be handled when the capability is deleted. Currently, the only supported value is <code>RETAIN</code> which retains all Kubernetes resources managed by the capability when the capability is deleted.</p>
308 /// <p>Because resources are retained, all Kubernetes resources created by the capability should be deleted from the cluster before deleting the capability itself. After the capability is deleted, these resources become difficult to manage because the controller is no longer available.</p>
309 pub fn get_delete_propagation_policy(&self) -> &::std::option::Option<crate::types::CapabilityDeletePropagationPolicy> {
310 self.inner.get_delete_propagation_policy()
311 }
312}