aws_sdk_secretsmanager/operation/create_secret/builders.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::create_secret::_create_secret_output::CreateSecretOutputBuilder;
3
4pub use crate::operation::create_secret::_create_secret_input::CreateSecretInputBuilder;
5
6impl crate::operation::create_secret::builders::CreateSecretInputBuilder {
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_secret::CreateSecretOutput,
13 ::aws_smithy_runtime_api::client::result::SdkError<
14 crate::operation::create_secret::CreateSecretError,
15 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16 >,
17 > {
18 let mut fluent_builder = client.create_secret();
19 fluent_builder.inner = self;
20 fluent_builder.send().await
21 }
22}
23/// Fluent builder constructing a request to `CreateSecret`.
24///
25/// <p>Creates a new secret. A <i>secret</i> can be a password, a set of credentials such as a user name and password, an OAuth token, or other secret information that you store in an encrypted form in Secrets Manager. The secret also includes the connection information to access a database or other service, which Secrets Manager doesn't encrypt. A secret in Secrets Manager consists of both the protected secret data and the important information needed to manage the secret.</p>
26/// <p>For secrets that use <i>managed rotation</i>, you need to create the secret through the managing service. For more information, see <a href="https://docs.aws.amazon.com/secretsmanager/latest/userguide/service-linked-secrets.html">Secrets Manager secrets managed by other Amazon Web Services services</a>.</p>
27/// <p>For information about creating a secret in the console, see <a href="https://docs.aws.amazon.com/secretsmanager/latest/userguide/manage_create-basic-secret.html">Create a secret</a>.</p>
28/// <p>To create a secret, you can provide the secret value to be encrypted in either the <code>SecretString</code> parameter or the <code>SecretBinary</code> parameter, but not both. If you include <code>SecretString</code> or <code>SecretBinary</code> then Secrets Manager creates an initial secret version and automatically attaches the staging label <code>AWSCURRENT</code> to it.</p>
29/// <p>For database credentials you want to rotate, for Secrets Manager to be able to rotate the secret, you must make sure the JSON you store in the <code>SecretString</code> matches the <a href="https://docs.aws.amazon.com/secretsmanager/latest/userguide/reference_secret_json_structure.html">JSON structure of a database secret</a>.</p>
30/// <p>If you don't specify an KMS encryption key, Secrets Manager uses the Amazon Web Services managed key <code>aws/secretsmanager</code>. If this key doesn't already exist in your account, then Secrets Manager creates it for you automatically. All users and roles in the Amazon Web Services account automatically have access to use <code>aws/secretsmanager</code>. Creating <code>aws/secretsmanager</code> can result in a one-time significant delay in returning the result.</p>
31/// <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>
32/// <p>Secrets Manager generates a CloudTrail log entry when you call this action. Do not include sensitive information in request parameters except <code>SecretBinary</code> or <code>SecretString</code> because it might be logged. For more information, see <a href="https://docs.aws.amazon.com/secretsmanager/latest/userguide/retrieve-ct-entries.html">Logging Secrets Manager events with CloudTrail</a>.</p>
33/// <p><b>Required permissions: </b> <code>secretsmanager:CreateSecret</code>. If you include tags in the secret, you also need <code>secretsmanager:TagResource</code>. To add replica Regions, you must also have <code>secretsmanager:ReplicateSecretToRegions</code>. For more information, see <a href="https://docs.aws.amazon.com/secretsmanager/latest/userguide/reference_iam-permissions.html#reference_iam-permissions_actions"> IAM policy actions for Secrets Manager</a> and <a href="https://docs.aws.amazon.com/secretsmanager/latest/userguide/auth-and-access.html">Authentication and access control in Secrets Manager</a>.</p>
34/// <p>To encrypt the secret with a KMS key other than <code>aws/secretsmanager</code>, you need <code>kms:GenerateDataKey</code> and <code>kms:Decrypt</code> permission to the key.</p><important>
35/// <p>When you enter commands in a command shell, there is a risk of the command history being accessed or utilities having access to your command parameters. This is a concern if the command includes the value of a secret. Learn how to <a href="https://docs.aws.amazon.com/secretsmanager/latest/userguide/security_cli-exposure-risks.html">Mitigate the risks of using command-line tools to store Secrets Manager secrets</a>.</p>
36/// </important>
37#[derive(::std::clone::Clone, ::std::fmt::Debug)]
38pub struct CreateSecretFluentBuilder {
39 handle: ::std::sync::Arc<crate::client::Handle>,
40 inner: crate::operation::create_secret::builders::CreateSecretInputBuilder,
41 config_override: ::std::option::Option<crate::config::Builder>,
42}
43impl
44 crate::client::customize::internal::CustomizableSend<
45 crate::operation::create_secret::CreateSecretOutput,
46 crate::operation::create_secret::CreateSecretError,
47 > for CreateSecretFluentBuilder
48{
49 fn send(
50 self,
51 config_override: crate::config::Builder,
52 ) -> crate::client::customize::internal::BoxFuture<
53 crate::client::customize::internal::SendResult<
54 crate::operation::create_secret::CreateSecretOutput,
55 crate::operation::create_secret::CreateSecretError,
56 >,
57 > {
58 ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
59 }
60}
61impl CreateSecretFluentBuilder {
62 /// Creates a new `CreateSecretFluentBuilder`.
63 pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
64 Self {
65 handle,
66 inner: ::std::default::Default::default(),
67 config_override: ::std::option::Option::None,
68 }
69 }
70 /// Access the CreateSecret as a reference.
71 pub fn as_input(&self) -> &crate::operation::create_secret::builders::CreateSecretInputBuilder {
72 &self.inner
73 }
74 /// Sends the request and returns the response.
75 ///
76 /// If an error occurs, an `SdkError` will be returned with additional details that
77 /// can be matched against.
78 ///
79 /// By default, any retryable failures will be retried twice. Retry behavior
80 /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
81 /// set when configuring the client.
82 pub async fn send(
83 self,
84 ) -> ::std::result::Result<
85 crate::operation::create_secret::CreateSecretOutput,
86 ::aws_smithy_runtime_api::client::result::SdkError<
87 crate::operation::create_secret::CreateSecretError,
88 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
89 >,
90 > {
91 let input = self
92 .inner
93 .build()
94 .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
95 let runtime_plugins = crate::operation::create_secret::CreateSecret::operation_runtime_plugins(
96 self.handle.runtime_plugins.clone(),
97 &self.handle.conf,
98 self.config_override,
99 );
100 crate::operation::create_secret::CreateSecret::orchestrate(&runtime_plugins, input).await
101 }
102
103 /// Consumes this builder, creating a customizable operation that can be modified before being sent.
104 pub fn customize(
105 self,
106 ) -> crate::client::customize::CustomizableOperation<
107 crate::operation::create_secret::CreateSecretOutput,
108 crate::operation::create_secret::CreateSecretError,
109 Self,
110 > {
111 crate::client::customize::CustomizableOperation::new(self)
112 }
113 pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
114 self.set_config_override(::std::option::Option::Some(config_override.into()));
115 self
116 }
117
118 pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
119 self.config_override = config_override;
120 self
121 }
122 /// <p>The name of the new secret.</p>
123 /// <p>The secret name can contain ASCII letters, numbers, and the following characters: /_+=.@-</p>
124 /// <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>
125 pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
126 self.inner = self.inner.name(input.into());
127 self
128 }
129 /// <p>The name of the new secret.</p>
130 /// <p>The secret name can contain ASCII letters, numbers, and the following characters: /_+=.@-</p>
131 /// <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>
132 pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
133 self.inner = self.inner.set_name(input);
134 self
135 }
136 /// <p>The name of the new secret.</p>
137 /// <p>The secret name can contain ASCII letters, numbers, and the following characters: /_+=.@-</p>
138 /// <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>
139 pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
140 self.inner.get_name()
141 }
142 /// <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>
143 /// <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>
144 /// </note>
145 /// <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>
146 /// <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>
147 /// <ul>
148 /// <li>
149 /// <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>
150 /// <li>
151 /// <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>
152 /// <li>
153 /// <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>
154 /// </ul>
155 /// <p>This value becomes the <code>VersionId</code> of the new version.</p>
156 pub fn client_request_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
157 self.inner = self.inner.client_request_token(input.into());
158 self
159 }
160 /// <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>
161 /// <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>
162 /// </note>
163 /// <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>
164 /// <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>
165 /// <ul>
166 /// <li>
167 /// <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>
168 /// <li>
169 /// <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>
170 /// <li>
171 /// <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>
172 /// </ul>
173 /// <p>This value becomes the <code>VersionId</code> of the new version.</p>
174 pub fn set_client_request_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
175 self.inner = self.inner.set_client_request_token(input);
176 self
177 }
178 /// <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>
179 /// <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>
180 /// </note>
181 /// <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>
182 /// <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>
183 /// <ul>
184 /// <li>
185 /// <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>
186 /// <li>
187 /// <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>
188 /// <li>
189 /// <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>
190 /// </ul>
191 /// <p>This value becomes the <code>VersionId</code> of the new version.</p>
192 pub fn get_client_request_token(&self) -> &::std::option::Option<::std::string::String> {
193 self.inner.get_client_request_token()
194 }
195 /// <p>The description of the secret.</p>
196 pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
197 self.inner = self.inner.description(input.into());
198 self
199 }
200 /// <p>The description of the secret.</p>
201 pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
202 self.inner = self.inner.set_description(input);
203 self
204 }
205 /// <p>The description of the secret.</p>
206 pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
207 self.inner.get_description()
208 }
209 /// <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>
210 /// <p>To use a KMS key in a different account, use the key ARN or the alias ARN.</p>
211 /// <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>
212 /// <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>
213 pub fn kms_key_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
214 self.inner = self.inner.kms_key_id(input.into());
215 self
216 }
217 /// <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>
218 /// <p>To use a KMS key in a different account, use the key ARN or the alias ARN.</p>
219 /// <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>
220 /// <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>
221 pub fn set_kms_key_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
222 self.inner = self.inner.set_kms_key_id(input);
223 self
224 }
225 /// <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>
226 /// <p>To use a KMS key in a different account, use the key ARN or the alias ARN.</p>
227 /// <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>
228 /// <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>
229 pub fn get_kms_key_id(&self) -> &::std::option::Option<::std::string::String> {
230 self.inner.get_kms_key_id()
231 }
232 /// <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>
233 /// <p>Either <code>SecretString</code> or <code>SecretBinary</code> must have a value, but not both.</p>
234 /// <p>This parameter is not available in the Secrets Manager console.</p>
235 /// <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>
236 pub fn secret_binary(mut self, input: ::aws_smithy_types::Blob) -> Self {
237 self.inner = self.inner.secret_binary(input);
238 self
239 }
240 /// <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>
241 /// <p>Either <code>SecretString</code> or <code>SecretBinary</code> must have a value, but not both.</p>
242 /// <p>This parameter is not available in the Secrets Manager console.</p>
243 /// <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>
244 pub fn set_secret_binary(mut self, input: ::std::option::Option<::aws_smithy_types::Blob>) -> Self {
245 self.inner = self.inner.set_secret_binary(input);
246 self
247 }
248 /// <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>
249 /// <p>Either <code>SecretString</code> or <code>SecretBinary</code> must have a value, but not both.</p>
250 /// <p>This parameter is not available in the Secrets Manager console.</p>
251 /// <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>
252 pub fn get_secret_binary(&self) -> &::std::option::Option<::aws_smithy_types::Blob> {
253 self.inner.get_secret_binary()
254 }
255 /// <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>
256 /// <p>Either <code>SecretString</code> or <code>SecretBinary</code> must have a value, but not both.</p>
257 /// <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>
258 /// <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>
259 pub fn secret_string(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
260 self.inner = self.inner.secret_string(input.into());
261 self
262 }
263 /// <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>
264 /// <p>Either <code>SecretString</code> or <code>SecretBinary</code> must have a value, but not both.</p>
265 /// <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>
266 /// <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>
267 pub fn set_secret_string(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
268 self.inner = self.inner.set_secret_string(input);
269 self
270 }
271 /// <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>
272 /// <p>Either <code>SecretString</code> or <code>SecretBinary</code> must have a value, but not both.</p>
273 /// <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>
274 /// <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>
275 pub fn get_secret_string(&self) -> &::std::option::Option<::std::string::String> {
276 self.inner.get_secret_string()
277 }
278 ///
279 /// Appends an item to `Tags`.
280 ///
281 /// To override the contents of this collection use [`set_tags`](Self::set_tags).
282 ///
283 /// <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>
284 /// <p><code>\[{"Key":"CostCenter","Value":"12345"},{"Key":"environment","Value":"production"}\]</code></p>
285 /// <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>
286 /// <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>
287 /// <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>
288 /// <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>
289 pub fn tags(mut self, input: crate::types::Tag) -> Self {
290 self.inner = self.inner.tags(input);
291 self
292 }
293 /// <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>
294 /// <p><code>\[{"Key":"CostCenter","Value":"12345"},{"Key":"environment","Value":"production"}\]</code></p>
295 /// <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>
296 /// <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>
297 /// <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>
298 /// <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>
299 pub fn set_tags(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>) -> Self {
300 self.inner = self.inner.set_tags(input);
301 self
302 }
303 /// <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>
304 /// <p><code>\[{"Key":"CostCenter","Value":"12345"},{"Key":"environment","Value":"production"}\]</code></p>
305 /// <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>
306 /// <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>
307 /// <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>
308 /// <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>
309 pub fn get_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Tag>> {
310 self.inner.get_tags()
311 }
312 ///
313 /// Appends an item to `AddReplicaRegions`.
314 ///
315 /// To override the contents of this collection use [`set_add_replica_regions`](Self::set_add_replica_regions).
316 ///
317 /// <p>A list of Regions and KMS keys to replicate secrets.</p>
318 pub fn add_replica_regions(mut self, input: crate::types::ReplicaRegionType) -> Self {
319 self.inner = self.inner.add_replica_regions(input);
320 self
321 }
322 /// <p>A list of Regions and KMS keys to replicate secrets.</p>
323 pub fn set_add_replica_regions(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::ReplicaRegionType>>) -> Self {
324 self.inner = self.inner.set_add_replica_regions(input);
325 self
326 }
327 /// <p>A list of Regions and KMS keys to replicate secrets.</p>
328 pub fn get_add_replica_regions(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::ReplicaRegionType>> {
329 self.inner.get_add_replica_regions()
330 }
331 /// <p>Specifies whether to overwrite a secret with the same name in the destination Region. By default, secrets aren't overwritten.</p>
332 pub fn force_overwrite_replica_secret(mut self, input: bool) -> Self {
333 self.inner = self.inner.force_overwrite_replica_secret(input);
334 self
335 }
336 /// <p>Specifies whether to overwrite a secret with the same name in the destination Region. By default, secrets aren't overwritten.</p>
337 pub fn set_force_overwrite_replica_secret(mut self, input: ::std::option::Option<bool>) -> Self {
338 self.inner = self.inner.set_force_overwrite_replica_secret(input);
339 self
340 }
341 /// <p>Specifies whether to overwrite a secret with the same name in the destination Region. By default, secrets aren't overwritten.</p>
342 pub fn get_force_overwrite_replica_secret(&self) -> &::std::option::Option<bool> {
343 self.inner.get_force_overwrite_replica_secret()
344 }
345}