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>
19 pub rotation_rules: ::std::option::Option<crate::types::RotationRulesType>,
20 /// <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>
21 /// <p>For secrets that use a Lambda rotation function to rotate, if you don't immediately rotate the secret, Secrets Manager tests the rotation configuration by running the <a href="https://docs.aws.amazon.com/secretsmanager/latest/userguide/rotate-secrets_lambda-functions.html#rotate-secrets_lambda-functions-code"> <code>testSecret</code> step</a> of the Lambda rotation function. The test creates an <code>AWSPENDING</code> version of the secret and then removes it.</p>
22 /// <p>By default, Secrets Manager rotates the secret immediately.</p>
23 pub rotate_immediately: ::std::option::Option<bool>,
24}
25impl RotateSecretInput {
26 /// <p>The ARN or name of the secret to rotate.</p>
27 /// <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>
28 pub fn secret_id(&self) -> ::std::option::Option<&str> {
29 self.secret_id.as_deref()
30 }
31 /// <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>
32 /// <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>
33 /// </note>
34 /// <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>
35 /// <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>
36 pub fn client_request_token(&self) -> ::std::option::Option<&str> {
37 self.client_request_token.as_deref()
38 }
39 /// <p>For secrets that use a Lambda rotation function to rotate, the ARN of the Lambda rotation function.</p>
40 /// <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>
41 pub fn rotation_lambda_arn(&self) -> ::std::option::Option<&str> {
42 self.rotation_lambda_arn.as_deref()
43 }
44 /// <p>A structure that defines the rotation configuration for this secret.</p>
45 pub fn rotation_rules(&self) -> ::std::option::Option<&crate::types::RotationRulesType> {
46 self.rotation_rules.as_ref()
47 }
48 /// <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>
49 /// <p>For secrets that use a Lambda rotation function to rotate, if you don't immediately rotate the secret, Secrets Manager tests the rotation configuration by running the <a href="https://docs.aws.amazon.com/secretsmanager/latest/userguide/rotate-secrets_lambda-functions.html#rotate-secrets_lambda-functions-code"> <code>testSecret</code> step</a> of the Lambda rotation function. The test creates an <code>AWSPENDING</code> version of the secret and then removes it.</p>
50 /// <p>By default, Secrets Manager rotates the secret immediately.</p>
51 pub fn rotate_immediately(&self) -> ::std::option::Option<bool> {
52 self.rotate_immediately
53 }
54}
55impl RotateSecretInput {
56 /// Creates a new builder-style object to manufacture [`RotateSecretInput`](crate::operation::rotate_secret::RotateSecretInput).
57 pub fn builder() -> crate::operation::rotate_secret::builders::RotateSecretInputBuilder {
58 crate::operation::rotate_secret::builders::RotateSecretInputBuilder::default()
59 }
60}
61
62/// A builder for [`RotateSecretInput`](crate::operation::rotate_secret::RotateSecretInput).
63#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
64#[non_exhaustive]
65pub struct RotateSecretInputBuilder {
66 pub(crate) secret_id: ::std::option::Option<::std::string::String>,
67 pub(crate) client_request_token: ::std::option::Option<::std::string::String>,
68 pub(crate) rotation_lambda_arn: ::std::option::Option<::std::string::String>,
69 pub(crate) rotation_rules: ::std::option::Option<crate::types::RotationRulesType>,
70 pub(crate) rotate_immediately: ::std::option::Option<bool>,
71}
72impl RotateSecretInputBuilder {
73 /// <p>The ARN or name of the secret to rotate.</p>
74 /// <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>
75 /// This field is required.
76 pub fn secret_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
77 self.secret_id = ::std::option::Option::Some(input.into());
78 self
79 }
80 /// <p>The ARN or name of the secret to rotate.</p>
81 /// <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>
82 pub fn set_secret_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
83 self.secret_id = input;
84 self
85 }
86 /// <p>The ARN or name of the secret to rotate.</p>
87 /// <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>
88 pub fn get_secret_id(&self) -> &::std::option::Option<::std::string::String> {
89 &self.secret_id
90 }
91 /// <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>
92 /// <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>
93 /// </note>
94 /// <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>
95 /// <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>
96 pub fn client_request_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
97 self.client_request_token = ::std::option::Option::Some(input.into());
98 self
99 }
100 /// <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>
101 /// <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>
102 /// </note>
103 /// <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>
104 /// <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>
105 pub fn set_client_request_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
106 self.client_request_token = input;
107 self
108 }
109 /// <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>
110 /// <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>
111 /// </note>
112 /// <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>
113 /// <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>
114 pub fn get_client_request_token(&self) -> &::std::option::Option<::std::string::String> {
115 &self.client_request_token
116 }
117 /// <p>For secrets that use a Lambda rotation function to rotate, the ARN of the Lambda rotation function.</p>
118 /// <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>
119 pub fn rotation_lambda_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
120 self.rotation_lambda_arn = ::std::option::Option::Some(input.into());
121 self
122 }
123 /// <p>For secrets that use a Lambda rotation function to rotate, the ARN of the Lambda rotation function.</p>
124 /// <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>
125 pub fn set_rotation_lambda_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
126 self.rotation_lambda_arn = input;
127 self
128 }
129 /// <p>For secrets that use a Lambda rotation function to rotate, the ARN of the Lambda rotation function.</p>
130 /// <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>
131 pub fn get_rotation_lambda_arn(&self) -> &::std::option::Option<::std::string::String> {
132 &self.rotation_lambda_arn
133 }
134 /// <p>A structure that defines the rotation configuration for this secret.</p>
135 pub fn rotation_rules(mut self, input: crate::types::RotationRulesType) -> Self {
136 self.rotation_rules = ::std::option::Option::Some(input);
137 self
138 }
139 /// <p>A structure that defines the rotation configuration for this secret.</p>
140 pub fn set_rotation_rules(mut self, input: ::std::option::Option<crate::types::RotationRulesType>) -> Self {
141 self.rotation_rules = input;
142 self
143 }
144 /// <p>A structure that defines the rotation configuration for this secret.</p>
145 pub fn get_rotation_rules(&self) -> &::std::option::Option<crate::types::RotationRulesType> {
146 &self.rotation_rules
147 }
148 /// <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>
149 /// <p>For secrets that use a Lambda rotation function to rotate, if you don't immediately rotate the secret, Secrets Manager tests the rotation configuration by running the <a href="https://docs.aws.amazon.com/secretsmanager/latest/userguide/rotate-secrets_lambda-functions.html#rotate-secrets_lambda-functions-code"> <code>testSecret</code> step</a> of the Lambda rotation function. The test creates an <code>AWSPENDING</code> version of the secret and then removes it.</p>
150 /// <p>By default, Secrets Manager rotates the secret immediately.</p>
151 pub fn rotate_immediately(mut self, input: bool) -> Self {
152 self.rotate_immediately = ::std::option::Option::Some(input);
153 self
154 }
155 /// <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>
156 /// <p>For secrets that use a Lambda rotation function to rotate, if you don't immediately rotate the secret, Secrets Manager tests the rotation configuration by running the <a href="https://docs.aws.amazon.com/secretsmanager/latest/userguide/rotate-secrets_lambda-functions.html#rotate-secrets_lambda-functions-code"> <code>testSecret</code> step</a> of the Lambda rotation function. The test creates an <code>AWSPENDING</code> version of the secret and then removes it.</p>
157 /// <p>By default, Secrets Manager rotates the secret immediately.</p>
158 pub fn set_rotate_immediately(mut self, input: ::std::option::Option<bool>) -> Self {
159 self.rotate_immediately = input;
160 self
161 }
162 /// <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>
163 /// <p>For secrets that use a Lambda rotation function to rotate, if you don't immediately rotate the secret, Secrets Manager tests the rotation configuration by running the <a href="https://docs.aws.amazon.com/secretsmanager/latest/userguide/rotate-secrets_lambda-functions.html#rotate-secrets_lambda-functions-code"> <code>testSecret</code> step</a> of the Lambda rotation function. The test creates an <code>AWSPENDING</code> version of the secret and then removes it.</p>
164 /// <p>By default, Secrets Manager rotates the secret immediately.</p>
165 pub fn get_rotate_immediately(&self) -> &::std::option::Option<bool> {
166 &self.rotate_immediately
167 }
168 /// Consumes the builder and constructs a [`RotateSecretInput`](crate::operation::rotate_secret::RotateSecretInput).
169 pub fn build(
170 self,
171 ) -> ::std::result::Result<crate::operation::rotate_secret::RotateSecretInput, ::aws_smithy_types::error::operation::BuildError> {
172 ::std::result::Result::Ok(crate::operation::rotate_secret::RotateSecretInput {
173 secret_id: self.secret_id,
174 client_request_token: self.client_request_token,
175 rotation_lambda_arn: self.rotation_lambda_arn,
176 rotation_rules: self.rotation_rules,
177 rotate_immediately: self.rotate_immediately,
178 })
179 }
180}