aws_sdk_kms/operation/delete_custom_key_store/builders.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::delete_custom_key_store::_delete_custom_key_store_output::DeleteCustomKeyStoreOutputBuilder;
3
4pub use crate::operation::delete_custom_key_store::_delete_custom_key_store_input::DeleteCustomKeyStoreInputBuilder;
5
6impl crate::operation::delete_custom_key_store::builders::DeleteCustomKeyStoreInputBuilder {
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::delete_custom_key_store::DeleteCustomKeyStoreOutput,
13 ::aws_smithy_runtime_api::client::result::SdkError<
14 crate::operation::delete_custom_key_store::DeleteCustomKeyStoreError,
15 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16 >,
17 > {
18 let mut fluent_builder = client.delete_custom_key_store();
19 fluent_builder.inner = self;
20 fluent_builder.send().await
21 }
22}
23/// Fluent builder constructing a request to `DeleteCustomKeyStore`.
24///
25/// <p>Deletes a <a href="https://docs.aws.amazon.com/kms/latest/developerguide/custom-key-store-overview.html">custom key store</a>. This operation does not affect any backing elements of the custom key store. It does not delete the CloudHSM cluster that is associated with an CloudHSM key store, or affect any users or keys in the cluster. For an external key store, it does not affect the external key store proxy, external key manager, or any external keys.</p>
26/// <p>This operation is part of the <a href="https://docs.aws.amazon.com/kms/latest/developerguide/custom-key-store-overview.html">custom key stores</a> feature in KMS, which combines the convenience and extensive integration of KMS with the isolation and control of a key store that you own and manage.</p>
27/// <p>The custom key store that you delete cannot contain any <a href="https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#kms_keys">KMS keys</a>. Before deleting the key store, verify that you will never need to use any of the KMS keys in the key store for any <a href="https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#cryptographic-operations">cryptographic operations</a>. Then, use <code>ScheduleKeyDeletion</code> to delete the KMS keys from the key store. After the required waiting period expires and all KMS keys are deleted from the custom key store, use <code>DisconnectCustomKeyStore</code> to disconnect the key store from KMS. Then, you can delete the custom key store.</p>
28/// <p>For keys in an CloudHSM key store, the <code>ScheduleKeyDeletion</code> operation makes a best effort to delete the key material from the associated cluster. However, you might need to manually <a href="https://docs.aws.amazon.com/kms/latest/developerguide/fix-keystore.html#fix-keystore-orphaned-key">delete the orphaned key material</a> from the cluster and its backups. KMS never creates, manages, or deletes cryptographic keys in the external key manager associated with an external key store. You must manage them using your external key manager tools.</p>
29/// <p>Instead of deleting the custom key store, consider using the <code>DisconnectCustomKeyStore</code> operation to disconnect the custom key store from its backing key store. While the key store is disconnected, you cannot create or use the KMS keys in the key store. But, you do not need to delete KMS keys and you can reconnect a disconnected custom key store at any time.</p>
30/// <p>If the operation succeeds, it returns a JSON object with no properties.</p>
31/// <p><b>Cross-account use</b>: No. You cannot perform this operation on a custom key store in a different Amazon Web Services account.</p>
32/// <p><b>Required permissions</b>: <a href="https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html">kms:DeleteCustomKeyStore</a> (IAM policy)</p>
33/// <p><b>Related operations:</b></p>
34/// <ul>
35/// <li>
36/// <p><code>ConnectCustomKeyStore</code></p></li>
37/// <li>
38/// <p><code>CreateCustomKeyStore</code></p></li>
39/// <li>
40/// <p><code>DescribeCustomKeyStores</code></p></li>
41/// <li>
42/// <p><code>DisconnectCustomKeyStore</code></p></li>
43/// <li>
44/// <p><code>UpdateCustomKeyStore</code></p></li>
45/// </ul>
46/// <p><b>Eventual consistency</b>: The KMS API follows an eventual consistency model. For more information, see <a href="https://docs.aws.amazon.com/kms/latest/developerguide/programming-eventual-consistency.html">KMS eventual consistency</a>.</p>
47#[derive(::std::clone::Clone, ::std::fmt::Debug)]
48pub struct DeleteCustomKeyStoreFluentBuilder {
49 handle: ::std::sync::Arc<crate::client::Handle>,
50 inner: crate::operation::delete_custom_key_store::builders::DeleteCustomKeyStoreInputBuilder,
51 config_override: ::std::option::Option<crate::config::Builder>,
52}
53impl
54 crate::client::customize::internal::CustomizableSend<
55 crate::operation::delete_custom_key_store::DeleteCustomKeyStoreOutput,
56 crate::operation::delete_custom_key_store::DeleteCustomKeyStoreError,
57 > for DeleteCustomKeyStoreFluentBuilder
58{
59 fn send(
60 self,
61 config_override: crate::config::Builder,
62 ) -> crate::client::customize::internal::BoxFuture<
63 crate::client::customize::internal::SendResult<
64 crate::operation::delete_custom_key_store::DeleteCustomKeyStoreOutput,
65 crate::operation::delete_custom_key_store::DeleteCustomKeyStoreError,
66 >,
67 > {
68 ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
69 }
70}
71impl DeleteCustomKeyStoreFluentBuilder {
72 /// Creates a new `DeleteCustomKeyStoreFluentBuilder`.
73 pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
74 Self {
75 handle,
76 inner: ::std::default::Default::default(),
77 config_override: ::std::option::Option::None,
78 }
79 }
80 /// Access the DeleteCustomKeyStore as a reference.
81 pub fn as_input(&self) -> &crate::operation::delete_custom_key_store::builders::DeleteCustomKeyStoreInputBuilder {
82 &self.inner
83 }
84 /// Sends the request and returns the response.
85 ///
86 /// If an error occurs, an `SdkError` will be returned with additional details that
87 /// can be matched against.
88 ///
89 /// By default, any retryable failures will be retried twice. Retry behavior
90 /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
91 /// set when configuring the client.
92 pub async fn send(
93 self,
94 ) -> ::std::result::Result<
95 crate::operation::delete_custom_key_store::DeleteCustomKeyStoreOutput,
96 ::aws_smithy_runtime_api::client::result::SdkError<
97 crate::operation::delete_custom_key_store::DeleteCustomKeyStoreError,
98 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
99 >,
100 > {
101 let input = self
102 .inner
103 .build()
104 .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
105 let runtime_plugins = crate::operation::delete_custom_key_store::DeleteCustomKeyStore::operation_runtime_plugins(
106 self.handle.runtime_plugins.clone(),
107 &self.handle.conf,
108 self.config_override,
109 );
110 crate::operation::delete_custom_key_store::DeleteCustomKeyStore::orchestrate(&runtime_plugins, input).await
111 }
112
113 /// Consumes this builder, creating a customizable operation that can be modified before being sent.
114 pub fn customize(
115 self,
116 ) -> crate::client::customize::CustomizableOperation<
117 crate::operation::delete_custom_key_store::DeleteCustomKeyStoreOutput,
118 crate::operation::delete_custom_key_store::DeleteCustomKeyStoreError,
119 Self,
120 > {
121 crate::client::customize::CustomizableOperation::new(self)
122 }
123 pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
124 self.set_config_override(::std::option::Option::Some(config_override.into()));
125 self
126 }
127
128 pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
129 self.config_override = config_override;
130 self
131 }
132 /// <p>Enter the ID of the custom key store you want to delete. To find the ID of a custom key store, use the <code>DescribeCustomKeyStores</code> operation.</p>
133 pub fn custom_key_store_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
134 self.inner = self.inner.custom_key_store_id(input.into());
135 self
136 }
137 /// <p>Enter the ID of the custom key store you want to delete. To find the ID of a custom key store, use the <code>DescribeCustomKeyStores</code> operation.</p>
138 pub fn set_custom_key_store_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
139 self.inner = self.inner.set_custom_key_store_id(input);
140 self
141 }
142 /// <p>Enter the ID of the custom key store you want to delete. To find the ID of a custom key store, use the <code>DescribeCustomKeyStores</code> operation.</p>
143 pub fn get_custom_key_store_id(&self) -> &::std::option::Option<::std::string::String> {
144 self.inner.get_custom_key_store_id()
145 }
146}