aws_sdk_secretsmanager/operation/create_secret/
_create_secret_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)]
5pub struct CreateSecretInput {
6    /// <p>The name of the new secret.</p>
7    /// <p>The secret name can contain ASCII letters, numbers, and the following characters: /_+=.@-</p>
8    /// <p>Do not end your secret name with a hyphen followed by six characters. If you do so, you risk confusion and unexpected results when searching for a secret by partial ARN. Secrets Manager automatically adds a hyphen and six random characters after the secret name at the end of the ARN.</p>
9    pub name: ::std::option::Option<::std::string::String>,
10    /// <p>If you include <code>SecretString</code> or <code>SecretBinary</code>, then Secrets Manager creates an initial version for the secret, and this parameter specifies the unique identifier for the new version.</p><note>
11    /// <p>If you use the Amazon Web Services CLI or one of the Amazon Web Services SDKs to call this operation, then you can leave this parameter empty. The CLI or SDK generates a random UUID for you and includes it as the value for this parameter in the request.</p>
12    /// </note>
13    /// <p>If you generate a raw HTTP request to the Secrets Manager service endpoint, then you must generate a <code>ClientRequestToken</code> and include it in the request.</p>
14    /// <p>This value helps ensure idempotency. Secrets Manager uses this value to prevent the accidental creation of duplicate versions if there are failures and retries during a rotation. We recommend that you generate a <a href="https://wikipedia.org/wiki/Universally_unique_identifier">UUID-type</a> value to ensure uniqueness of your versions within the specified secret.</p>
15    /// <ul>
16    /// <li>
17    /// <p>If the <code>ClientRequestToken</code> value isn't already associated with a version of the secret then a new version of the secret is created.</p></li>
18    /// <li>
19    /// <p>If a version with this value already exists and the version <code>SecretString</code> and <code>SecretBinary</code> values are the same as those in the request, then the request is ignored.</p></li>
20    /// <li>
21    /// <p>If a version with this value already exists and that version's <code>SecretString</code> and <code>SecretBinary</code> values are different from those in the request, then the request fails because you cannot modify an existing version. Instead, use <code>PutSecretValue</code> to create a new version.</p></li>
22    /// </ul>
23    /// <p>This value becomes the <code>VersionId</code> of the new version.</p>
24    pub client_request_token: ::std::option::Option<::std::string::String>,
25    /// <p>The description of the secret.</p>
26    pub description: ::std::option::Option<::std::string::String>,
27    /// <p>The ARN, key ID, or alias of the KMS key that Secrets Manager uses to encrypt the secret value in the secret. An alias is always prefixed by <code>alias/</code>, for example <code>alias/aws/secretsmanager</code>. For more information, see <a href="https://docs.aws.amazon.com/kms/latest/developerguide/alias-about.html">About aliases</a>.</p>
28    /// <p>To use a KMS key in a different account, use the key ARN or the alias ARN.</p>
29    /// <p>If you don't specify this value, then Secrets Manager uses the key <code>aws/secretsmanager</code>. If that key doesn't yet exist, then Secrets Manager creates it for you automatically the first time it encrypts the secret value.</p>
30    /// <p>If the secret is in a different Amazon Web Services account from the credentials calling the API, then you can't use <code>aws/secretsmanager</code> to encrypt the secret, and you must create and use a customer managed KMS key.</p>
31    pub kms_key_id: ::std::option::Option<::std::string::String>,
32    /// <p>The binary data to encrypt and store in the new version of the secret. We recommend that you store your binary data in a file and then pass the contents of the file as a parameter.</p>
33    /// <p>Either <code>SecretString</code> or <code>SecretBinary</code> must have a value, but not both.</p>
34    /// <p>This parameter is not available in the Secrets Manager console.</p>
35    /// <p>Sensitive: This field contains sensitive information, so the service does not include it in CloudTrail log entries. If you create your own log entries, you must also avoid logging the information in this field.</p>
36    pub secret_binary: ::std::option::Option<::aws_smithy_types::Blob>,
37    /// <p>The text data to encrypt and store in this new version of the secret. We recommend you use a JSON structure of key/value pairs for your secret value.</p>
38    /// <p>Either <code>SecretString</code> or <code>SecretBinary</code> must have a value, but not both.</p>
39    /// <p>If you create a secret by using the Secrets Manager console then Secrets Manager puts the protected secret text in only the <code>SecretString</code> parameter. The Secrets Manager console stores the information as a JSON structure of key/value pairs that a Lambda rotation function can parse.</p>
40    /// <p>Sensitive: This field contains sensitive information, so the service does not include it in CloudTrail log entries. If you create your own log entries, you must also avoid logging the information in this field.</p>
41    pub secret_string: ::std::option::Option<::std::string::String>,
42    /// <p>A list of tags to attach to the secret. Each tag is a key and value pair of strings in a JSON text string, for example:</p>
43    /// <p><code>\[{"Key":"CostCenter","Value":"12345"},{"Key":"environment","Value":"production"}\]</code></p>
44    /// <p>Secrets Manager tag key names are case sensitive. A tag with the key "ABC" is a different tag from one with key "abc".</p>
45    /// <p>If you check tags in permissions policies as part of your security strategy, then adding or removing a tag can change permissions. If the completion of this operation would result in you losing your permissions for this secret, then Secrets Manager blocks the operation and returns an <code>Access Denied</code> error. For more information, see <a href="https://docs.aws.amazon.com/secretsmanager/latest/userguide/auth-and-access_examples.html#tag-secrets-abac">Control access to secrets using tags</a> and <a href="https://docs.aws.amazon.com/secretsmanager/latest/userguide/auth-and-access_examples.html#auth-and-access_tags2">Limit access to identities with tags that match secrets' tags</a>.</p>
46    /// <p>For information about how to format a JSON parameter for the various command line tool environments, see <a href="https://docs.aws.amazon.com/cli/latest/userguide/cli-using-param.html#cli-using-param-json">Using JSON for Parameters</a>. If your command-line tool or SDK requires quotation marks around the parameter, you should use single quotes to avoid confusion with the double quotes required in the JSON text.</p>
47    /// <p>For tag quotas and naming restrictions, see <a href="https://docs.aws.amazon.com/general/latest/gr/arg.html#taged-reference-quotas">Service quotas for Tagging</a> in the <i>Amazon Web Services General Reference guide</i>.</p>
48    pub tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
49    /// <p>A list of Regions and KMS keys to replicate secrets.</p>
50    pub add_replica_regions: ::std::option::Option<::std::vec::Vec<crate::types::ReplicaRegionType>>,
51    /// <p>Specifies whether to overwrite a secret with the same name in the destination Region. By default, secrets aren't overwritten.</p>
52    pub force_overwrite_replica_secret: ::std::option::Option<bool>,
53}
54impl CreateSecretInput {
55    /// <p>The name of the new secret.</p>
56    /// <p>The secret name can contain ASCII letters, numbers, and the following characters: /_+=.@-</p>
57    /// <p>Do not end your secret name with a hyphen followed by six characters. If you do so, you risk confusion and unexpected results when searching for a secret by partial ARN. Secrets Manager automatically adds a hyphen and six random characters after the secret name at the end of the ARN.</p>
58    pub fn name(&self) -> ::std::option::Option<&str> {
59        self.name.as_deref()
60    }
61    /// <p>If you include <code>SecretString</code> or <code>SecretBinary</code>, then Secrets Manager creates an initial version for the secret, and this parameter specifies the unique identifier for the new version.</p><note>
62    /// <p>If you use the Amazon Web Services CLI or one of the Amazon Web Services SDKs to call this operation, then you can leave this parameter empty. The CLI or SDK generates a random UUID for you and includes it as the value for this parameter in the request.</p>
63    /// </note>
64    /// <p>If you generate a raw HTTP request to the Secrets Manager service endpoint, then you must generate a <code>ClientRequestToken</code> and include it in the request.</p>
65    /// <p>This value helps ensure idempotency. Secrets Manager uses this value to prevent the accidental creation of duplicate versions if there are failures and retries during a rotation. We recommend that you generate a <a href="https://wikipedia.org/wiki/Universally_unique_identifier">UUID-type</a> value to ensure uniqueness of your versions within the specified secret.</p>
66    /// <ul>
67    /// <li>
68    /// <p>If the <code>ClientRequestToken</code> value isn't already associated with a version of the secret then a new version of the secret is created.</p></li>
69    /// <li>
70    /// <p>If a version with this value already exists and the version <code>SecretString</code> and <code>SecretBinary</code> values are the same as those in the request, then the request is ignored.</p></li>
71    /// <li>
72    /// <p>If a version with this value already exists and that version's <code>SecretString</code> and <code>SecretBinary</code> values are different from those in the request, then the request fails because you cannot modify an existing version. Instead, use <code>PutSecretValue</code> to create a new version.</p></li>
73    /// </ul>
74    /// <p>This value becomes the <code>VersionId</code> of the new version.</p>
75    pub fn client_request_token(&self) -> ::std::option::Option<&str> {
76        self.client_request_token.as_deref()
77    }
78    /// <p>The description of the secret.</p>
79    pub fn description(&self) -> ::std::option::Option<&str> {
80        self.description.as_deref()
81    }
82    /// <p>The ARN, key ID, or alias of the KMS key that Secrets Manager uses to encrypt the secret value in the secret. An alias is always prefixed by <code>alias/</code>, for example <code>alias/aws/secretsmanager</code>. For more information, see <a href="https://docs.aws.amazon.com/kms/latest/developerguide/alias-about.html">About aliases</a>.</p>
83    /// <p>To use a KMS key in a different account, use the key ARN or the alias ARN.</p>
84    /// <p>If you don't specify this value, then Secrets Manager uses the key <code>aws/secretsmanager</code>. If that key doesn't yet exist, then Secrets Manager creates it for you automatically the first time it encrypts the secret value.</p>
85    /// <p>If the secret is in a different Amazon Web Services account from the credentials calling the API, then you can't use <code>aws/secretsmanager</code> to encrypt the secret, and you must create and use a customer managed KMS key.</p>
86    pub fn kms_key_id(&self) -> ::std::option::Option<&str> {
87        self.kms_key_id.as_deref()
88    }
89    /// <p>The binary data to encrypt and store in the new version of the secret. We recommend that you store your binary data in a file and then pass the contents of the file as a parameter.</p>
90    /// <p>Either <code>SecretString</code> or <code>SecretBinary</code> must have a value, but not both.</p>
91    /// <p>This parameter is not available in the Secrets Manager console.</p>
92    /// <p>Sensitive: This field contains sensitive information, so the service does not include it in CloudTrail log entries. If you create your own log entries, you must also avoid logging the information in this field.</p>
93    pub fn secret_binary(&self) -> ::std::option::Option<&::aws_smithy_types::Blob> {
94        self.secret_binary.as_ref()
95    }
96    /// <p>The text data to encrypt and store in this new version of the secret. We recommend you use a JSON structure of key/value pairs for your secret value.</p>
97    /// <p>Either <code>SecretString</code> or <code>SecretBinary</code> must have a value, but not both.</p>
98    /// <p>If you create a secret by using the Secrets Manager console then Secrets Manager puts the protected secret text in only the <code>SecretString</code> parameter. The Secrets Manager console stores the information as a JSON structure of key/value pairs that a Lambda rotation function can parse.</p>
99    /// <p>Sensitive: This field contains sensitive information, so the service does not include it in CloudTrail log entries. If you create your own log entries, you must also avoid logging the information in this field.</p>
100    pub fn secret_string(&self) -> ::std::option::Option<&str> {
101        self.secret_string.as_deref()
102    }
103    /// <p>A list of tags to attach to the secret. Each tag is a key and value pair of strings in a JSON text string, for example:</p>
104    /// <p><code>\[{"Key":"CostCenter","Value":"12345"},{"Key":"environment","Value":"production"}\]</code></p>
105    /// <p>Secrets Manager tag key names are case sensitive. A tag with the key "ABC" is a different tag from one with key "abc".</p>
106    /// <p>If you check tags in permissions policies as part of your security strategy, then adding or removing a tag can change permissions. If the completion of this operation would result in you losing your permissions for this secret, then Secrets Manager blocks the operation and returns an <code>Access Denied</code> error. For more information, see <a href="https://docs.aws.amazon.com/secretsmanager/latest/userguide/auth-and-access_examples.html#tag-secrets-abac">Control access to secrets using tags</a> and <a href="https://docs.aws.amazon.com/secretsmanager/latest/userguide/auth-and-access_examples.html#auth-and-access_tags2">Limit access to identities with tags that match secrets' tags</a>.</p>
107    /// <p>For information about how to format a JSON parameter for the various command line tool environments, see <a href="https://docs.aws.amazon.com/cli/latest/userguide/cli-using-param.html#cli-using-param-json">Using JSON for Parameters</a>. If your command-line tool or SDK requires quotation marks around the parameter, you should use single quotes to avoid confusion with the double quotes required in the JSON text.</p>
108    /// <p>For tag quotas and naming restrictions, see <a href="https://docs.aws.amazon.com/general/latest/gr/arg.html#taged-reference-quotas">Service quotas for Tagging</a> in the <i>Amazon Web Services General Reference guide</i>.</p>
109    ///
110    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.tags.is_none()`.
111    pub fn tags(&self) -> &[crate::types::Tag] {
112        self.tags.as_deref().unwrap_or_default()
113    }
114    /// <p>A list of Regions and KMS keys to replicate secrets.</p>
115    ///
116    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.add_replica_regions.is_none()`.
117    pub fn add_replica_regions(&self) -> &[crate::types::ReplicaRegionType] {
118        self.add_replica_regions.as_deref().unwrap_or_default()
119    }
120    /// <p>Specifies whether to overwrite a secret with the same name in the destination Region. By default, secrets aren't overwritten.</p>
121    pub fn force_overwrite_replica_secret(&self) -> ::std::option::Option<bool> {
122        self.force_overwrite_replica_secret
123    }
124}
125impl ::std::fmt::Debug for CreateSecretInput {
126    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
127        let mut formatter = f.debug_struct("CreateSecretInput");
128        formatter.field("name", &self.name);
129        formatter.field("client_request_token", &self.client_request_token);
130        formatter.field("description", &self.description);
131        formatter.field("kms_key_id", &self.kms_key_id);
132        formatter.field("secret_binary", &"*** Sensitive Data Redacted ***");
133        formatter.field("secret_string", &"*** Sensitive Data Redacted ***");
134        formatter.field("tags", &self.tags);
135        formatter.field("add_replica_regions", &self.add_replica_regions);
136        formatter.field("force_overwrite_replica_secret", &self.force_overwrite_replica_secret);
137        formatter.finish()
138    }
139}
140impl CreateSecretInput {
141    /// Creates a new builder-style object to manufacture [`CreateSecretInput`](crate::operation::create_secret::CreateSecretInput).
142    pub fn builder() -> crate::operation::create_secret::builders::CreateSecretInputBuilder {
143        crate::operation::create_secret::builders::CreateSecretInputBuilder::default()
144    }
145}
146
147/// A builder for [`CreateSecretInput`](crate::operation::create_secret::CreateSecretInput).
148#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)]
149#[non_exhaustive]
150pub struct CreateSecretInputBuilder {
151    pub(crate) name: ::std::option::Option<::std::string::String>,
152    pub(crate) client_request_token: ::std::option::Option<::std::string::String>,
153    pub(crate) description: ::std::option::Option<::std::string::String>,
154    pub(crate) kms_key_id: ::std::option::Option<::std::string::String>,
155    pub(crate) secret_binary: ::std::option::Option<::aws_smithy_types::Blob>,
156    pub(crate) secret_string: ::std::option::Option<::std::string::String>,
157    pub(crate) tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
158    pub(crate) add_replica_regions: ::std::option::Option<::std::vec::Vec<crate::types::ReplicaRegionType>>,
159    pub(crate) force_overwrite_replica_secret: ::std::option::Option<bool>,
160}
161impl CreateSecretInputBuilder {
162    /// <p>The name of the new secret.</p>
163    /// <p>The secret name can contain ASCII letters, numbers, and the following characters: /_+=.@-</p>
164    /// <p>Do not end your secret name with a hyphen followed by six characters. If you do so, you risk confusion and unexpected results when searching for a secret by partial ARN. Secrets Manager automatically adds a hyphen and six random characters after the secret name at the end of the ARN.</p>
165    /// This field is required.
166    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
167        self.name = ::std::option::Option::Some(input.into());
168        self
169    }
170    /// <p>The name of the new secret.</p>
171    /// <p>The secret name can contain ASCII letters, numbers, and the following characters: /_+=.@-</p>
172    /// <p>Do not end your secret name with a hyphen followed by six characters. If you do so, you risk confusion and unexpected results when searching for a secret by partial ARN. Secrets Manager automatically adds a hyphen and six random characters after the secret name at the end of the ARN.</p>
173    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
174        self.name = input;
175        self
176    }
177    /// <p>The name of the new secret.</p>
178    /// <p>The secret name can contain ASCII letters, numbers, and the following characters: /_+=.@-</p>
179    /// <p>Do not end your secret name with a hyphen followed by six characters. If you do so, you risk confusion and unexpected results when searching for a secret by partial ARN. Secrets Manager automatically adds a hyphen and six random characters after the secret name at the end of the ARN.</p>
180    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
181        &self.name
182    }
183    /// <p>If you include <code>SecretString</code> or <code>SecretBinary</code>, then Secrets Manager creates an initial version for the secret, and this parameter specifies the unique identifier for the new version.</p><note>
184    /// <p>If you use the Amazon Web Services CLI or one of the Amazon Web Services SDKs to call this operation, then you can leave this parameter empty. The CLI or SDK generates a random UUID for you and includes it as the value for this parameter in the request.</p>
185    /// </note>
186    /// <p>If you generate a raw HTTP request to the Secrets Manager service endpoint, then you must generate a <code>ClientRequestToken</code> and include it in the request.</p>
187    /// <p>This value helps ensure idempotency. Secrets Manager uses this value to prevent the accidental creation of duplicate versions if there are failures and retries during a rotation. We recommend that you generate a <a href="https://wikipedia.org/wiki/Universally_unique_identifier">UUID-type</a> value to ensure uniqueness of your versions within the specified secret.</p>
188    /// <ul>
189    /// <li>
190    /// <p>If the <code>ClientRequestToken</code> value isn't already associated with a version of the secret then a new version of the secret is created.</p></li>
191    /// <li>
192    /// <p>If a version with this value already exists and the version <code>SecretString</code> and <code>SecretBinary</code> values are the same as those in the request, then the request is ignored.</p></li>
193    /// <li>
194    /// <p>If a version with this value already exists and that version's <code>SecretString</code> and <code>SecretBinary</code> values are different from those in the request, then the request fails because you cannot modify an existing version. Instead, use <code>PutSecretValue</code> to create a new version.</p></li>
195    /// </ul>
196    /// <p>This value becomes the <code>VersionId</code> of the new version.</p>
197    pub fn client_request_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
198        self.client_request_token = ::std::option::Option::Some(input.into());
199        self
200    }
201    /// <p>If you include <code>SecretString</code> or <code>SecretBinary</code>, then Secrets Manager creates an initial version for the secret, and this parameter specifies the unique identifier for the new version.</p><note>
202    /// <p>If you use the Amazon Web Services CLI or one of the Amazon Web Services SDKs to call this operation, then you can leave this parameter empty. The CLI or SDK generates a random UUID for you and includes it as the value for this parameter in the request.</p>
203    /// </note>
204    /// <p>If you generate a raw HTTP request to the Secrets Manager service endpoint, then you must generate a <code>ClientRequestToken</code> and include it in the request.</p>
205    /// <p>This value helps ensure idempotency. Secrets Manager uses this value to prevent the accidental creation of duplicate versions if there are failures and retries during a rotation. We recommend that you generate a <a href="https://wikipedia.org/wiki/Universally_unique_identifier">UUID-type</a> value to ensure uniqueness of your versions within the specified secret.</p>
206    /// <ul>
207    /// <li>
208    /// <p>If the <code>ClientRequestToken</code> value isn't already associated with a version of the secret then a new version of the secret is created.</p></li>
209    /// <li>
210    /// <p>If a version with this value already exists and the version <code>SecretString</code> and <code>SecretBinary</code> values are the same as those in the request, then the request is ignored.</p></li>
211    /// <li>
212    /// <p>If a version with this value already exists and that version's <code>SecretString</code> and <code>SecretBinary</code> values are different from those in the request, then the request fails because you cannot modify an existing version. Instead, use <code>PutSecretValue</code> to create a new version.</p></li>
213    /// </ul>
214    /// <p>This value becomes the <code>VersionId</code> of the new version.</p>
215    pub fn set_client_request_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
216        self.client_request_token = input;
217        self
218    }
219    /// <p>If you include <code>SecretString</code> or <code>SecretBinary</code>, then Secrets Manager creates an initial version for the secret, and this parameter specifies the unique identifier for the new version.</p><note>
220    /// <p>If you use the Amazon Web Services CLI or one of the Amazon Web Services SDKs to call this operation, then you can leave this parameter empty. The CLI or SDK generates a random UUID for you and includes it as the value for this parameter in the request.</p>
221    /// </note>
222    /// <p>If you generate a raw HTTP request to the Secrets Manager service endpoint, then you must generate a <code>ClientRequestToken</code> and include it in the request.</p>
223    /// <p>This value helps ensure idempotency. Secrets Manager uses this value to prevent the accidental creation of duplicate versions if there are failures and retries during a rotation. We recommend that you generate a <a href="https://wikipedia.org/wiki/Universally_unique_identifier">UUID-type</a> value to ensure uniqueness of your versions within the specified secret.</p>
224    /// <ul>
225    /// <li>
226    /// <p>If the <code>ClientRequestToken</code> value isn't already associated with a version of the secret then a new version of the secret is created.</p></li>
227    /// <li>
228    /// <p>If a version with this value already exists and the version <code>SecretString</code> and <code>SecretBinary</code> values are the same as those in the request, then the request is ignored.</p></li>
229    /// <li>
230    /// <p>If a version with this value already exists and that version's <code>SecretString</code> and <code>SecretBinary</code> values are different from those in the request, then the request fails because you cannot modify an existing version. Instead, use <code>PutSecretValue</code> to create a new version.</p></li>
231    /// </ul>
232    /// <p>This value becomes the <code>VersionId</code> of the new version.</p>
233    pub fn get_client_request_token(&self) -> &::std::option::Option<::std::string::String> {
234        &self.client_request_token
235    }
236    /// <p>The description of the secret.</p>
237    pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
238        self.description = ::std::option::Option::Some(input.into());
239        self
240    }
241    /// <p>The description of the secret.</p>
242    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
243        self.description = input;
244        self
245    }
246    /// <p>The description of the secret.</p>
247    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
248        &self.description
249    }
250    /// <p>The ARN, key ID, or alias of the KMS key that Secrets Manager uses to encrypt the secret value in the secret. An alias is always prefixed by <code>alias/</code>, for example <code>alias/aws/secretsmanager</code>. For more information, see <a href="https://docs.aws.amazon.com/kms/latest/developerguide/alias-about.html">About aliases</a>.</p>
251    /// <p>To use a KMS key in a different account, use the key ARN or the alias ARN.</p>
252    /// <p>If you don't specify this value, then Secrets Manager uses the key <code>aws/secretsmanager</code>. If that key doesn't yet exist, then Secrets Manager creates it for you automatically the first time it encrypts the secret value.</p>
253    /// <p>If the secret is in a different Amazon Web Services account from the credentials calling the API, then you can't use <code>aws/secretsmanager</code> to encrypt the secret, and you must create and use a customer managed KMS key.</p>
254    pub fn kms_key_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
255        self.kms_key_id = ::std::option::Option::Some(input.into());
256        self
257    }
258    /// <p>The ARN, key ID, or alias of the KMS key that Secrets Manager uses to encrypt the secret value in the secret. An alias is always prefixed by <code>alias/</code>, for example <code>alias/aws/secretsmanager</code>. For more information, see <a href="https://docs.aws.amazon.com/kms/latest/developerguide/alias-about.html">About aliases</a>.</p>
259    /// <p>To use a KMS key in a different account, use the key ARN or the alias ARN.</p>
260    /// <p>If you don't specify this value, then Secrets Manager uses the key <code>aws/secretsmanager</code>. If that key doesn't yet exist, then Secrets Manager creates it for you automatically the first time it encrypts the secret value.</p>
261    /// <p>If the secret is in a different Amazon Web Services account from the credentials calling the API, then you can't use <code>aws/secretsmanager</code> to encrypt the secret, and you must create and use a customer managed KMS key.</p>
262    pub fn set_kms_key_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
263        self.kms_key_id = input;
264        self
265    }
266    /// <p>The ARN, key ID, or alias of the KMS key that Secrets Manager uses to encrypt the secret value in the secret. An alias is always prefixed by <code>alias/</code>, for example <code>alias/aws/secretsmanager</code>. For more information, see <a href="https://docs.aws.amazon.com/kms/latest/developerguide/alias-about.html">About aliases</a>.</p>
267    /// <p>To use a KMS key in a different account, use the key ARN or the alias ARN.</p>
268    /// <p>If you don't specify this value, then Secrets Manager uses the key <code>aws/secretsmanager</code>. If that key doesn't yet exist, then Secrets Manager creates it for you automatically the first time it encrypts the secret value.</p>
269    /// <p>If the secret is in a different Amazon Web Services account from the credentials calling the API, then you can't use <code>aws/secretsmanager</code> to encrypt the secret, and you must create and use a customer managed KMS key.</p>
270    pub fn get_kms_key_id(&self) -> &::std::option::Option<::std::string::String> {
271        &self.kms_key_id
272    }
273    /// <p>The binary data to encrypt and store in the new version of the secret. We recommend that you store your binary data in a file and then pass the contents of the file as a parameter.</p>
274    /// <p>Either <code>SecretString</code> or <code>SecretBinary</code> must have a value, but not both.</p>
275    /// <p>This parameter is not available in the Secrets Manager console.</p>
276    /// <p>Sensitive: This field contains sensitive information, so the service does not include it in CloudTrail log entries. If you create your own log entries, you must also avoid logging the information in this field.</p>
277    pub fn secret_binary(mut self, input: ::aws_smithy_types::Blob) -> Self {
278        self.secret_binary = ::std::option::Option::Some(input);
279        self
280    }
281    /// <p>The binary data to encrypt and store in the new version of the secret. We recommend that you store your binary data in a file and then pass the contents of the file as a parameter.</p>
282    /// <p>Either <code>SecretString</code> or <code>SecretBinary</code> must have a value, but not both.</p>
283    /// <p>This parameter is not available in the Secrets Manager console.</p>
284    /// <p>Sensitive: This field contains sensitive information, so the service does not include it in CloudTrail log entries. If you create your own log entries, you must also avoid logging the information in this field.</p>
285    pub fn set_secret_binary(mut self, input: ::std::option::Option<::aws_smithy_types::Blob>) -> Self {
286        self.secret_binary = input;
287        self
288    }
289    /// <p>The binary data to encrypt and store in the new version of the secret. We recommend that you store your binary data in a file and then pass the contents of the file as a parameter.</p>
290    /// <p>Either <code>SecretString</code> or <code>SecretBinary</code> must have a value, but not both.</p>
291    /// <p>This parameter is not available in the Secrets Manager console.</p>
292    /// <p>Sensitive: This field contains sensitive information, so the service does not include it in CloudTrail log entries. If you create your own log entries, you must also avoid logging the information in this field.</p>
293    pub fn get_secret_binary(&self) -> &::std::option::Option<::aws_smithy_types::Blob> {
294        &self.secret_binary
295    }
296    /// <p>The text data to encrypt and store in this new version of the secret. We recommend you use a JSON structure of key/value pairs for your secret value.</p>
297    /// <p>Either <code>SecretString</code> or <code>SecretBinary</code> must have a value, but not both.</p>
298    /// <p>If you create a secret by using the Secrets Manager console then Secrets Manager puts the protected secret text in only the <code>SecretString</code> parameter. The Secrets Manager console stores the information as a JSON structure of key/value pairs that a Lambda rotation function can parse.</p>
299    /// <p>Sensitive: This field contains sensitive information, so the service does not include it in CloudTrail log entries. If you create your own log entries, you must also avoid logging the information in this field.</p>
300    pub fn secret_string(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
301        self.secret_string = ::std::option::Option::Some(input.into());
302        self
303    }
304    /// <p>The text data to encrypt and store in this new version of the secret. We recommend you use a JSON structure of key/value pairs for your secret value.</p>
305    /// <p>Either <code>SecretString</code> or <code>SecretBinary</code> must have a value, but not both.</p>
306    /// <p>If you create a secret by using the Secrets Manager console then Secrets Manager puts the protected secret text in only the <code>SecretString</code> parameter. The Secrets Manager console stores the information as a JSON structure of key/value pairs that a Lambda rotation function can parse.</p>
307    /// <p>Sensitive: This field contains sensitive information, so the service does not include it in CloudTrail log entries. If you create your own log entries, you must also avoid logging the information in this field.</p>
308    pub fn set_secret_string(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
309        self.secret_string = input;
310        self
311    }
312    /// <p>The text data to encrypt and store in this new version of the secret. We recommend you use a JSON structure of key/value pairs for your secret value.</p>
313    /// <p>Either <code>SecretString</code> or <code>SecretBinary</code> must have a value, but not both.</p>
314    /// <p>If you create a secret by using the Secrets Manager console then Secrets Manager puts the protected secret text in only the <code>SecretString</code> parameter. The Secrets Manager console stores the information as a JSON structure of key/value pairs that a Lambda rotation function can parse.</p>
315    /// <p>Sensitive: This field contains sensitive information, so the service does not include it in CloudTrail log entries. If you create your own log entries, you must also avoid logging the information in this field.</p>
316    pub fn get_secret_string(&self) -> &::std::option::Option<::std::string::String> {
317        &self.secret_string
318    }
319    /// Appends an item to `tags`.
320    ///
321    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
322    ///
323    /// <p>A list of tags to attach to the secret. Each tag is a key and value pair of strings in a JSON text string, for example:</p>
324    /// <p><code>\[{"Key":"CostCenter","Value":"12345"},{"Key":"environment","Value":"production"}\]</code></p>
325    /// <p>Secrets Manager tag key names are case sensitive. A tag with the key "ABC" is a different tag from one with key "abc".</p>
326    /// <p>If you check tags in permissions policies as part of your security strategy, then adding or removing a tag can change permissions. If the completion of this operation would result in you losing your permissions for this secret, then Secrets Manager blocks the operation and returns an <code>Access Denied</code> error. For more information, see <a href="https://docs.aws.amazon.com/secretsmanager/latest/userguide/auth-and-access_examples.html#tag-secrets-abac">Control access to secrets using tags</a> and <a href="https://docs.aws.amazon.com/secretsmanager/latest/userguide/auth-and-access_examples.html#auth-and-access_tags2">Limit access to identities with tags that match secrets' tags</a>.</p>
327    /// <p>For information about how to format a JSON parameter for the various command line tool environments, see <a href="https://docs.aws.amazon.com/cli/latest/userguide/cli-using-param.html#cli-using-param-json">Using JSON for Parameters</a>. If your command-line tool or SDK requires quotation marks around the parameter, you should use single quotes to avoid confusion with the double quotes required in the JSON text.</p>
328    /// <p>For tag quotas and naming restrictions, see <a href="https://docs.aws.amazon.com/general/latest/gr/arg.html#taged-reference-quotas">Service quotas for Tagging</a> in the <i>Amazon Web Services General Reference guide</i>.</p>
329    pub fn tags(mut self, input: crate::types::Tag) -> Self {
330        let mut v = self.tags.unwrap_or_default();
331        v.push(input);
332        self.tags = ::std::option::Option::Some(v);
333        self
334    }
335    /// <p>A list of tags to attach to the secret. Each tag is a key and value pair of strings in a JSON text string, for example:</p>
336    /// <p><code>\[{"Key":"CostCenter","Value":"12345"},{"Key":"environment","Value":"production"}\]</code></p>
337    /// <p>Secrets Manager tag key names are case sensitive. A tag with the key "ABC" is a different tag from one with key "abc".</p>
338    /// <p>If you check tags in permissions policies as part of your security strategy, then adding or removing a tag can change permissions. If the completion of this operation would result in you losing your permissions for this secret, then Secrets Manager blocks the operation and returns an <code>Access Denied</code> error. For more information, see <a href="https://docs.aws.amazon.com/secretsmanager/latest/userguide/auth-and-access_examples.html#tag-secrets-abac">Control access to secrets using tags</a> and <a href="https://docs.aws.amazon.com/secretsmanager/latest/userguide/auth-and-access_examples.html#auth-and-access_tags2">Limit access to identities with tags that match secrets' tags</a>.</p>
339    /// <p>For information about how to format a JSON parameter for the various command line tool environments, see <a href="https://docs.aws.amazon.com/cli/latest/userguide/cli-using-param.html#cli-using-param-json">Using JSON for Parameters</a>. If your command-line tool or SDK requires quotation marks around the parameter, you should use single quotes to avoid confusion with the double quotes required in the JSON text.</p>
340    /// <p>For tag quotas and naming restrictions, see <a href="https://docs.aws.amazon.com/general/latest/gr/arg.html#taged-reference-quotas">Service quotas for Tagging</a> in the <i>Amazon Web Services General Reference guide</i>.</p>
341    pub fn set_tags(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>) -> Self {
342        self.tags = input;
343        self
344    }
345    /// <p>A list of tags to attach to the secret. Each tag is a key and value pair of strings in a JSON text string, for example:</p>
346    /// <p><code>\[{"Key":"CostCenter","Value":"12345"},{"Key":"environment","Value":"production"}\]</code></p>
347    /// <p>Secrets Manager tag key names are case sensitive. A tag with the key "ABC" is a different tag from one with key "abc".</p>
348    /// <p>If you check tags in permissions policies as part of your security strategy, then adding or removing a tag can change permissions. If the completion of this operation would result in you losing your permissions for this secret, then Secrets Manager blocks the operation and returns an <code>Access Denied</code> error. For more information, see <a href="https://docs.aws.amazon.com/secretsmanager/latest/userguide/auth-and-access_examples.html#tag-secrets-abac">Control access to secrets using tags</a> and <a href="https://docs.aws.amazon.com/secretsmanager/latest/userguide/auth-and-access_examples.html#auth-and-access_tags2">Limit access to identities with tags that match secrets' tags</a>.</p>
349    /// <p>For information about how to format a JSON parameter for the various command line tool environments, see <a href="https://docs.aws.amazon.com/cli/latest/userguide/cli-using-param.html#cli-using-param-json">Using JSON for Parameters</a>. If your command-line tool or SDK requires quotation marks around the parameter, you should use single quotes to avoid confusion with the double quotes required in the JSON text.</p>
350    /// <p>For tag quotas and naming restrictions, see <a href="https://docs.aws.amazon.com/general/latest/gr/arg.html#taged-reference-quotas">Service quotas for Tagging</a> in the <i>Amazon Web Services General Reference guide</i>.</p>
351    pub fn get_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Tag>> {
352        &self.tags
353    }
354    /// Appends an item to `add_replica_regions`.
355    ///
356    /// To override the contents of this collection use [`set_add_replica_regions`](Self::set_add_replica_regions).
357    ///
358    /// <p>A list of Regions and KMS keys to replicate secrets.</p>
359    pub fn add_replica_regions(mut self, input: crate::types::ReplicaRegionType) -> Self {
360        let mut v = self.add_replica_regions.unwrap_or_default();
361        v.push(input);
362        self.add_replica_regions = ::std::option::Option::Some(v);
363        self
364    }
365    /// <p>A list of Regions and KMS keys to replicate secrets.</p>
366    pub fn set_add_replica_regions(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::ReplicaRegionType>>) -> Self {
367        self.add_replica_regions = input;
368        self
369    }
370    /// <p>A list of Regions and KMS keys to replicate secrets.</p>
371    pub fn get_add_replica_regions(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::ReplicaRegionType>> {
372        &self.add_replica_regions
373    }
374    /// <p>Specifies whether to overwrite a secret with the same name in the destination Region. By default, secrets aren't overwritten.</p>
375    pub fn force_overwrite_replica_secret(mut self, input: bool) -> Self {
376        self.force_overwrite_replica_secret = ::std::option::Option::Some(input);
377        self
378    }
379    /// <p>Specifies whether to overwrite a secret with the same name in the destination Region. By default, secrets aren't overwritten.</p>
380    pub fn set_force_overwrite_replica_secret(mut self, input: ::std::option::Option<bool>) -> Self {
381        self.force_overwrite_replica_secret = input;
382        self
383    }
384    /// <p>Specifies whether to overwrite a secret with the same name in the destination Region. By default, secrets aren't overwritten.</p>
385    pub fn get_force_overwrite_replica_secret(&self) -> &::std::option::Option<bool> {
386        &self.force_overwrite_replica_secret
387    }
388    /// Consumes the builder and constructs a [`CreateSecretInput`](crate::operation::create_secret::CreateSecretInput).
389    pub fn build(
390        self,
391    ) -> ::std::result::Result<crate::operation::create_secret::CreateSecretInput, ::aws_smithy_types::error::operation::BuildError> {
392        ::std::result::Result::Ok(crate::operation::create_secret::CreateSecretInput {
393            name: self.name,
394            client_request_token: self.client_request_token,
395            description: self.description,
396            kms_key_id: self.kms_key_id,
397            secret_binary: self.secret_binary,
398            secret_string: self.secret_string,
399            tags: self.tags,
400            add_replica_regions: self.add_replica_regions,
401            force_overwrite_replica_secret: self.force_overwrite_replica_secret,
402        })
403    }
404}
405impl ::std::fmt::Debug for CreateSecretInputBuilder {
406    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
407        let mut formatter = f.debug_struct("CreateSecretInputBuilder");
408        formatter.field("name", &self.name);
409        formatter.field("client_request_token", &self.client_request_token);
410        formatter.field("description", &self.description);
411        formatter.field("kms_key_id", &self.kms_key_id);
412        formatter.field("secret_binary", &"*** Sensitive Data Redacted ***");
413        formatter.field("secret_string", &"*** Sensitive Data Redacted ***");
414        formatter.field("tags", &self.tags);
415        formatter.field("add_replica_regions", &self.add_replica_regions);
416        formatter.field("force_overwrite_replica_secret", &self.force_overwrite_replica_secret);
417        formatter.finish()
418    }
419}