aws_sdk_secretsmanager/operation/rotate_secret/_rotate_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, ::std::fmt::Debug)]
5pub struct RotateSecretInput {
6 /// <p>The ARN or name of the secret to rotate.</p>
7 /// <p>For an ARN, we recommend that you specify a complete ARN rather than a partial ARN. See <a href="https://docs.aws.amazon.com/secretsmanager/latest/userguide/troubleshoot.html#ARN_secretnamehyphen">Finding a secret from a partial ARN</a>.</p>
8 pub secret_id: ::std::option::Option<::std::string::String>,
9 /// <p>A unique identifier for the new version of the secret. You only need to specify this value if you implement your own retry logic and you want to ensure that Secrets Manager doesn't attempt to create a secret version twice.</p><note>
10 /// <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>
11 /// </note>
12 /// <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>
13 /// <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>
14 pub client_request_token: ::std::option::Option<::std::string::String>,
15 /// <p>For secrets that use a Lambda rotation function to rotate, the ARN of the Lambda rotation function.</p>
16 /// <p>For secrets that use <i>managed rotation</i>, omit this field. For more information, see <a href="https://docs.aws.amazon.com/secretsmanager/latest/userguide/rotate-secrets_managed.html">Managed rotation</a> in the <i>Secrets Manager User Guide</i>.</p>
17 pub rotation_lambda_arn: ::std::option::Option<::std::string::String>,
18 /// <p>A structure that defines the rotation configuration for this secret.</p><important>
19 /// <p>When changing an existing rotation schedule and setting <code>RotateImmediately</code> to <code>false</code>:</p>
20 /// <ul>
21 /// <li>
22 /// <p>If using <code>AutomaticallyAfterDays</code> or a <code>ScheduleExpression</code> with <code>rate()</code>, the previously scheduled rotation might still occur.</p></li>
23 /// <li>
24 /// <p>To prevent unintended rotations, use a <code>ScheduleExpression</code> with <code>cron()</code> for granular control over rotation windows.</p></li>
25 /// </ul>
26 /// </important>
27 pub rotation_rules: ::std::option::Option<crate::types::RotationRulesType>,
28 /// <p>The metadata needed to successfully rotate a managed external secret. A list of key value pairs in JSON format specified by the partner. For more information about the required information, see <a href="https://docs.aws.amazon.com/secretsmanager/latest/userguide/managed-external-secrets.html">Using Secrets Manager managed external secrets</a></p>
29 pub external_secret_rotation_metadata: ::std::option::Option<::std::vec::Vec<crate::types::ExternalSecretRotationMetadataItem>>,
30 /// <p>The Amazon Resource Name (ARN) of the role that allows Secrets Manager to rotate a secret held by a third-party partner. For more information, see <a href="https://docs.aws.amazon.com/secretsmanager/latest/userguide/mes-security.html">Security and permissions</a>.</p>
31 pub external_secret_rotation_role_arn: ::std::option::Option<::std::string::String>,
32 /// <p>Specifies whether to rotate the secret immediately or wait until the next scheduled rotation window. The rotation schedule is defined in <code>RotateSecretRequest$RotationRules</code>.</p>
33 /// <p>The default for <code>RotateImmediately</code> is <code>true</code>. If you don't specify this value, Secrets Manager rotates the secret immediately.</p>
34 /// <p>If you set <code>RotateImmediately</code> to <code>false</code>, Secrets Manager tests the rotation configuration by running the <a href="https://docs.aws.amazon.com/secretsmanager/latest/userguide/rotate-secrets_how.html"> <code>testSecret</code> step</a> of the Lambda rotation function. This test creates an <code>AWSPENDING</code> version of the secret and then removes it.</p>
35 /// <p>When changing an existing rotation schedule and setting <code>RotateImmediately</code> to <code>false</code>:</p>
36 /// <ul>
37 /// <li>
38 /// <p>If using <code>AutomaticallyAfterDays</code> or a <code>ScheduleExpression</code> with <code>rate()</code>, the previously scheduled rotation might still occur.</p></li>
39 /// <li>
40 /// <p>To prevent unintended rotations, use a <code>ScheduleExpression</code> with <code>cron()</code> for granular control over rotation windows.</p></li>
41 /// </ul>
42 /// <p>Rotation is an asynchronous process. For more information, see <a href="https://docs.aws.amazon.com/secretsmanager/latest/userguide/rotate-secrets_how.html">How rotation works</a>.</p>
43 pub rotate_immediately: ::std::option::Option<bool>,
44}
45impl RotateSecretInput {
46 /// <p>The ARN or name of the secret to rotate.</p>
47 /// <p>For an ARN, we recommend that you specify a complete ARN rather than a partial ARN. See <a href="https://docs.aws.amazon.com/secretsmanager/latest/userguide/troubleshoot.html#ARN_secretnamehyphen">Finding a secret from a partial ARN</a>.</p>
48 pub fn secret_id(&self) -> ::std::option::Option<&str> {
49 self.secret_id.as_deref()
50 }
51 /// <p>A unique identifier for the new version of the secret. You only need to specify this value if you implement your own retry logic and you want to ensure that Secrets Manager doesn't attempt to create a secret version twice.</p><note>
52 /// <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>
53 /// </note>
54 /// <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>
55 /// <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>
56 pub fn client_request_token(&self) -> ::std::option::Option<&str> {
57 self.client_request_token.as_deref()
58 }
59 /// <p>For secrets that use a Lambda rotation function to rotate, the ARN of the Lambda rotation function.</p>
60 /// <p>For secrets that use <i>managed rotation</i>, omit this field. For more information, see <a href="https://docs.aws.amazon.com/secretsmanager/latest/userguide/rotate-secrets_managed.html">Managed rotation</a> in the <i>Secrets Manager User Guide</i>.</p>
61 pub fn rotation_lambda_arn(&self) -> ::std::option::Option<&str> {
62 self.rotation_lambda_arn.as_deref()
63 }
64 /// <p>A structure that defines the rotation configuration for this secret.</p><important>
65 /// <p>When changing an existing rotation schedule and setting <code>RotateImmediately</code> to <code>false</code>:</p>
66 /// <ul>
67 /// <li>
68 /// <p>If using <code>AutomaticallyAfterDays</code> or a <code>ScheduleExpression</code> with <code>rate()</code>, the previously scheduled rotation might still occur.</p></li>
69 /// <li>
70 /// <p>To prevent unintended rotations, use a <code>ScheduleExpression</code> with <code>cron()</code> for granular control over rotation windows.</p></li>
71 /// </ul>
72 /// </important>
73 pub fn rotation_rules(&self) -> ::std::option::Option<&crate::types::RotationRulesType> {
74 self.rotation_rules.as_ref()
75 }
76 /// <p>The metadata needed to successfully rotate a managed external secret. A list of key value pairs in JSON format specified by the partner. For more information about the required information, see <a href="https://docs.aws.amazon.com/secretsmanager/latest/userguide/managed-external-secrets.html">Using Secrets Manager managed external secrets</a></p>
77 ///
78 /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.external_secret_rotation_metadata.is_none()`.
79 pub fn external_secret_rotation_metadata(&self) -> &[crate::types::ExternalSecretRotationMetadataItem] {
80 self.external_secret_rotation_metadata.as_deref().unwrap_or_default()
81 }
82 /// <p>The Amazon Resource Name (ARN) of the role that allows Secrets Manager to rotate a secret held by a third-party partner. For more information, see <a href="https://docs.aws.amazon.com/secretsmanager/latest/userguide/mes-security.html">Security and permissions</a>.</p>
83 pub fn external_secret_rotation_role_arn(&self) -> ::std::option::Option<&str> {
84 self.external_secret_rotation_role_arn.as_deref()
85 }
86 /// <p>Specifies whether to rotate the secret immediately or wait until the next scheduled rotation window. The rotation schedule is defined in <code>RotateSecretRequest$RotationRules</code>.</p>
87 /// <p>The default for <code>RotateImmediately</code> is <code>true</code>. If you don't specify this value, Secrets Manager rotates the secret immediately.</p>
88 /// <p>If you set <code>RotateImmediately</code> to <code>false</code>, Secrets Manager tests the rotation configuration by running the <a href="https://docs.aws.amazon.com/secretsmanager/latest/userguide/rotate-secrets_how.html"> <code>testSecret</code> step</a> of the Lambda rotation function. This test creates an <code>AWSPENDING</code> version of the secret and then removes it.</p>
89 /// <p>When changing an existing rotation schedule and setting <code>RotateImmediately</code> to <code>false</code>:</p>
90 /// <ul>
91 /// <li>
92 /// <p>If using <code>AutomaticallyAfterDays</code> or a <code>ScheduleExpression</code> with <code>rate()</code>, the previously scheduled rotation might still occur.</p></li>
93 /// <li>
94 /// <p>To prevent unintended rotations, use a <code>ScheduleExpression</code> with <code>cron()</code> for granular control over rotation windows.</p></li>
95 /// </ul>
96 /// <p>Rotation is an asynchronous process. For more information, see <a href="https://docs.aws.amazon.com/secretsmanager/latest/userguide/rotate-secrets_how.html">How rotation works</a>.</p>
97 pub fn rotate_immediately(&self) -> ::std::option::Option<bool> {
98 self.rotate_immediately
99 }
100}
101impl RotateSecretInput {
102 /// Creates a new builder-style object to manufacture [`RotateSecretInput`](crate::operation::rotate_secret::RotateSecretInput).
103 pub fn builder() -> crate::operation::rotate_secret::builders::RotateSecretInputBuilder {
104 crate::operation::rotate_secret::builders::RotateSecretInputBuilder::default()
105 }
106}
107
108/// A builder for [`RotateSecretInput`](crate::operation::rotate_secret::RotateSecretInput).
109#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
110#[non_exhaustive]
111pub struct RotateSecretInputBuilder {
112 pub(crate) secret_id: ::std::option::Option<::std::string::String>,
113 pub(crate) client_request_token: ::std::option::Option<::std::string::String>,
114 pub(crate) rotation_lambda_arn: ::std::option::Option<::std::string::String>,
115 pub(crate) rotation_rules: ::std::option::Option<crate::types::RotationRulesType>,
116 pub(crate) external_secret_rotation_metadata: ::std::option::Option<::std::vec::Vec<crate::types::ExternalSecretRotationMetadataItem>>,
117 pub(crate) external_secret_rotation_role_arn: ::std::option::Option<::std::string::String>,
118 pub(crate) rotate_immediately: ::std::option::Option<bool>,
119}
120impl RotateSecretInputBuilder {
121 /// <p>The ARN or name of the secret to rotate.</p>
122 /// <p>For an ARN, we recommend that you specify a complete ARN rather than a partial ARN. See <a href="https://docs.aws.amazon.com/secretsmanager/latest/userguide/troubleshoot.html#ARN_secretnamehyphen">Finding a secret from a partial ARN</a>.</p>
123 /// This field is required.
124 pub fn secret_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
125 self.secret_id = ::std::option::Option::Some(input.into());
126 self
127 }
128 /// <p>The ARN or name of the secret to rotate.</p>
129 /// <p>For an ARN, we recommend that you specify a complete ARN rather than a partial ARN. See <a href="https://docs.aws.amazon.com/secretsmanager/latest/userguide/troubleshoot.html#ARN_secretnamehyphen">Finding a secret from a partial ARN</a>.</p>
130 pub fn set_secret_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
131 self.secret_id = input;
132 self
133 }
134 /// <p>The ARN or name of the secret to rotate.</p>
135 /// <p>For an ARN, we recommend that you specify a complete ARN rather than a partial ARN. See <a href="https://docs.aws.amazon.com/secretsmanager/latest/userguide/troubleshoot.html#ARN_secretnamehyphen">Finding a secret from a partial ARN</a>.</p>
136 pub fn get_secret_id(&self) -> &::std::option::Option<::std::string::String> {
137 &self.secret_id
138 }
139 /// <p>A unique identifier for the new version of the secret. You only need to specify this value if you implement your own retry logic and you want to ensure that Secrets Manager doesn't attempt to create a secret version twice.</p><note>
140 /// <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>
141 /// </note>
142 /// <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>
143 /// <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>
144 pub fn client_request_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
145 self.client_request_token = ::std::option::Option::Some(input.into());
146 self
147 }
148 /// <p>A unique identifier for the new version of the secret. You only need to specify this value if you implement your own retry logic and you want to ensure that Secrets Manager doesn't attempt to create a secret version twice.</p><note>
149 /// <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>
150 /// </note>
151 /// <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>
152 /// <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>
153 pub fn set_client_request_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
154 self.client_request_token = input;
155 self
156 }
157 /// <p>A unique identifier for the new version of the secret. You only need to specify this value if you implement your own retry logic and you want to ensure that Secrets Manager doesn't attempt to create a secret version twice.</p><note>
158 /// <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>
159 /// </note>
160 /// <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>
161 /// <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>
162 pub fn get_client_request_token(&self) -> &::std::option::Option<::std::string::String> {
163 &self.client_request_token
164 }
165 /// <p>For secrets that use a Lambda rotation function to rotate, the ARN of the Lambda rotation function.</p>
166 /// <p>For secrets that use <i>managed rotation</i>, omit this field. For more information, see <a href="https://docs.aws.amazon.com/secretsmanager/latest/userguide/rotate-secrets_managed.html">Managed rotation</a> in the <i>Secrets Manager User Guide</i>.</p>
167 pub fn rotation_lambda_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
168 self.rotation_lambda_arn = ::std::option::Option::Some(input.into());
169 self
170 }
171 /// <p>For secrets that use a Lambda rotation function to rotate, the ARN of the Lambda rotation function.</p>
172 /// <p>For secrets that use <i>managed rotation</i>, omit this field. For more information, see <a href="https://docs.aws.amazon.com/secretsmanager/latest/userguide/rotate-secrets_managed.html">Managed rotation</a> in the <i>Secrets Manager User Guide</i>.</p>
173 pub fn set_rotation_lambda_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
174 self.rotation_lambda_arn = input;
175 self
176 }
177 /// <p>For secrets that use a Lambda rotation function to rotate, the ARN of the Lambda rotation function.</p>
178 /// <p>For secrets that use <i>managed rotation</i>, omit this field. For more information, see <a href="https://docs.aws.amazon.com/secretsmanager/latest/userguide/rotate-secrets_managed.html">Managed rotation</a> in the <i>Secrets Manager User Guide</i>.</p>
179 pub fn get_rotation_lambda_arn(&self) -> &::std::option::Option<::std::string::String> {
180 &self.rotation_lambda_arn
181 }
182 /// <p>A structure that defines the rotation configuration for this secret.</p><important>
183 /// <p>When changing an existing rotation schedule and setting <code>RotateImmediately</code> to <code>false</code>:</p>
184 /// <ul>
185 /// <li>
186 /// <p>If using <code>AutomaticallyAfterDays</code> or a <code>ScheduleExpression</code> with <code>rate()</code>, the previously scheduled rotation might still occur.</p></li>
187 /// <li>
188 /// <p>To prevent unintended rotations, use a <code>ScheduleExpression</code> with <code>cron()</code> for granular control over rotation windows.</p></li>
189 /// </ul>
190 /// </important>
191 pub fn rotation_rules(mut self, input: crate::types::RotationRulesType) -> Self {
192 self.rotation_rules = ::std::option::Option::Some(input);
193 self
194 }
195 /// <p>A structure that defines the rotation configuration for this secret.</p><important>
196 /// <p>When changing an existing rotation schedule and setting <code>RotateImmediately</code> to <code>false</code>:</p>
197 /// <ul>
198 /// <li>
199 /// <p>If using <code>AutomaticallyAfterDays</code> or a <code>ScheduleExpression</code> with <code>rate()</code>, the previously scheduled rotation might still occur.</p></li>
200 /// <li>
201 /// <p>To prevent unintended rotations, use a <code>ScheduleExpression</code> with <code>cron()</code> for granular control over rotation windows.</p></li>
202 /// </ul>
203 /// </important>
204 pub fn set_rotation_rules(mut self, input: ::std::option::Option<crate::types::RotationRulesType>) -> Self {
205 self.rotation_rules = input;
206 self
207 }
208 /// <p>A structure that defines the rotation configuration for this secret.</p><important>
209 /// <p>When changing an existing rotation schedule and setting <code>RotateImmediately</code> to <code>false</code>:</p>
210 /// <ul>
211 /// <li>
212 /// <p>If using <code>AutomaticallyAfterDays</code> or a <code>ScheduleExpression</code> with <code>rate()</code>, the previously scheduled rotation might still occur.</p></li>
213 /// <li>
214 /// <p>To prevent unintended rotations, use a <code>ScheduleExpression</code> with <code>cron()</code> for granular control over rotation windows.</p></li>
215 /// </ul>
216 /// </important>
217 pub fn get_rotation_rules(&self) -> &::std::option::Option<crate::types::RotationRulesType> {
218 &self.rotation_rules
219 }
220 /// Appends an item to `external_secret_rotation_metadata`.
221 ///
222 /// To override the contents of this collection use [`set_external_secret_rotation_metadata`](Self::set_external_secret_rotation_metadata).
223 ///
224 /// <p>The metadata needed to successfully rotate a managed external secret. A list of key value pairs in JSON format specified by the partner. For more information about the required information, see <a href="https://docs.aws.amazon.com/secretsmanager/latest/userguide/managed-external-secrets.html">Using Secrets Manager managed external secrets</a></p>
225 pub fn external_secret_rotation_metadata(mut self, input: crate::types::ExternalSecretRotationMetadataItem) -> Self {
226 let mut v = self.external_secret_rotation_metadata.unwrap_or_default();
227 v.push(input);
228 self.external_secret_rotation_metadata = ::std::option::Option::Some(v);
229 self
230 }
231 /// <p>The metadata needed to successfully rotate a managed external secret. A list of key value pairs in JSON format specified by the partner. For more information about the required information, see <a href="https://docs.aws.amazon.com/secretsmanager/latest/userguide/managed-external-secrets.html">Using Secrets Manager managed external secrets</a></p>
232 pub fn set_external_secret_rotation_metadata(
233 mut self,
234 input: ::std::option::Option<::std::vec::Vec<crate::types::ExternalSecretRotationMetadataItem>>,
235 ) -> Self {
236 self.external_secret_rotation_metadata = input;
237 self
238 }
239 /// <p>The metadata needed to successfully rotate a managed external secret. A list of key value pairs in JSON format specified by the partner. For more information about the required information, see <a href="https://docs.aws.amazon.com/secretsmanager/latest/userguide/managed-external-secrets.html">Using Secrets Manager managed external secrets</a></p>
240 pub fn get_external_secret_rotation_metadata(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::ExternalSecretRotationMetadataItem>> {
241 &self.external_secret_rotation_metadata
242 }
243 /// <p>The Amazon Resource Name (ARN) of the role that allows Secrets Manager to rotate a secret held by a third-party partner. For more information, see <a href="https://docs.aws.amazon.com/secretsmanager/latest/userguide/mes-security.html">Security and permissions</a>.</p>
244 pub fn external_secret_rotation_role_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
245 self.external_secret_rotation_role_arn = ::std::option::Option::Some(input.into());
246 self
247 }
248 /// <p>The Amazon Resource Name (ARN) of the role that allows Secrets Manager to rotate a secret held by a third-party partner. For more information, see <a href="https://docs.aws.amazon.com/secretsmanager/latest/userguide/mes-security.html">Security and permissions</a>.</p>
249 pub fn set_external_secret_rotation_role_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
250 self.external_secret_rotation_role_arn = input;
251 self
252 }
253 /// <p>The Amazon Resource Name (ARN) of the role that allows Secrets Manager to rotate a secret held by a third-party partner. For more information, see <a href="https://docs.aws.amazon.com/secretsmanager/latest/userguide/mes-security.html">Security and permissions</a>.</p>
254 pub fn get_external_secret_rotation_role_arn(&self) -> &::std::option::Option<::std::string::String> {
255 &self.external_secret_rotation_role_arn
256 }
257 /// <p>Specifies whether to rotate the secret immediately or wait until the next scheduled rotation window. The rotation schedule is defined in <code>RotateSecretRequest$RotationRules</code>.</p>
258 /// <p>The default for <code>RotateImmediately</code> is <code>true</code>. If you don't specify this value, Secrets Manager rotates the secret immediately.</p>
259 /// <p>If you set <code>RotateImmediately</code> to <code>false</code>, Secrets Manager tests the rotation configuration by running the <a href="https://docs.aws.amazon.com/secretsmanager/latest/userguide/rotate-secrets_how.html"> <code>testSecret</code> step</a> of the Lambda rotation function. This test creates an <code>AWSPENDING</code> version of the secret and then removes it.</p>
260 /// <p>When changing an existing rotation schedule and setting <code>RotateImmediately</code> to <code>false</code>:</p>
261 /// <ul>
262 /// <li>
263 /// <p>If using <code>AutomaticallyAfterDays</code> or a <code>ScheduleExpression</code> with <code>rate()</code>, the previously scheduled rotation might still occur.</p></li>
264 /// <li>
265 /// <p>To prevent unintended rotations, use a <code>ScheduleExpression</code> with <code>cron()</code> for granular control over rotation windows.</p></li>
266 /// </ul>
267 /// <p>Rotation is an asynchronous process. For more information, see <a href="https://docs.aws.amazon.com/secretsmanager/latest/userguide/rotate-secrets_how.html">How rotation works</a>.</p>
268 pub fn rotate_immediately(mut self, input: bool) -> Self {
269 self.rotate_immediately = ::std::option::Option::Some(input);
270 self
271 }
272 /// <p>Specifies whether to rotate the secret immediately or wait until the next scheduled rotation window. The rotation schedule is defined in <code>RotateSecretRequest$RotationRules</code>.</p>
273 /// <p>The default for <code>RotateImmediately</code> is <code>true</code>. If you don't specify this value, Secrets Manager rotates the secret immediately.</p>
274 /// <p>If you set <code>RotateImmediately</code> to <code>false</code>, Secrets Manager tests the rotation configuration by running the <a href="https://docs.aws.amazon.com/secretsmanager/latest/userguide/rotate-secrets_how.html"> <code>testSecret</code> step</a> of the Lambda rotation function. This test creates an <code>AWSPENDING</code> version of the secret and then removes it.</p>
275 /// <p>When changing an existing rotation schedule and setting <code>RotateImmediately</code> to <code>false</code>:</p>
276 /// <ul>
277 /// <li>
278 /// <p>If using <code>AutomaticallyAfterDays</code> or a <code>ScheduleExpression</code> with <code>rate()</code>, the previously scheduled rotation might still occur.</p></li>
279 /// <li>
280 /// <p>To prevent unintended rotations, use a <code>ScheduleExpression</code> with <code>cron()</code> for granular control over rotation windows.</p></li>
281 /// </ul>
282 /// <p>Rotation is an asynchronous process. For more information, see <a href="https://docs.aws.amazon.com/secretsmanager/latest/userguide/rotate-secrets_how.html">How rotation works</a>.</p>
283 pub fn set_rotate_immediately(mut self, input: ::std::option::Option<bool>) -> Self {
284 self.rotate_immediately = input;
285 self
286 }
287 /// <p>Specifies whether to rotate the secret immediately or wait until the next scheduled rotation window. The rotation schedule is defined in <code>RotateSecretRequest$RotationRules</code>.</p>
288 /// <p>The default for <code>RotateImmediately</code> is <code>true</code>. If you don't specify this value, Secrets Manager rotates the secret immediately.</p>
289 /// <p>If you set <code>RotateImmediately</code> to <code>false</code>, Secrets Manager tests the rotation configuration by running the <a href="https://docs.aws.amazon.com/secretsmanager/latest/userguide/rotate-secrets_how.html"> <code>testSecret</code> step</a> of the Lambda rotation function. This test creates an <code>AWSPENDING</code> version of the secret and then removes it.</p>
290 /// <p>When changing an existing rotation schedule and setting <code>RotateImmediately</code> to <code>false</code>:</p>
291 /// <ul>
292 /// <li>
293 /// <p>If using <code>AutomaticallyAfterDays</code> or a <code>ScheduleExpression</code> with <code>rate()</code>, the previously scheduled rotation might still occur.</p></li>
294 /// <li>
295 /// <p>To prevent unintended rotations, use a <code>ScheduleExpression</code> with <code>cron()</code> for granular control over rotation windows.</p></li>
296 /// </ul>
297 /// <p>Rotation is an asynchronous process. For more information, see <a href="https://docs.aws.amazon.com/secretsmanager/latest/userguide/rotate-secrets_how.html">How rotation works</a>.</p>
298 pub fn get_rotate_immediately(&self) -> &::std::option::Option<bool> {
299 &self.rotate_immediately
300 }
301 /// Consumes the builder and constructs a [`RotateSecretInput`](crate::operation::rotate_secret::RotateSecretInput).
302 pub fn build(
303 self,
304 ) -> ::std::result::Result<crate::operation::rotate_secret::RotateSecretInput, ::aws_smithy_types::error::operation::BuildError> {
305 ::std::result::Result::Ok(crate::operation::rotate_secret::RotateSecretInput {
306 secret_id: self.secret_id,
307 client_request_token: self.client_request_token,
308 rotation_lambda_arn: self.rotation_lambda_arn,
309 rotation_rules: self.rotation_rules,
310 external_secret_rotation_metadata: self.external_secret_rotation_metadata,
311 external_secret_rotation_role_arn: self.external_secret_rotation_role_arn,
312 rotate_immediately: self.rotate_immediately,
313 })
314 }
315}