Skip to content

Commit 57ae98d

Browse files
author
awstools
committed
feat(client-secrets-manager): Introducing RotationToken parameter for PutSecretValue API
1 parent ef64589 commit 57ae98d

File tree

4 files changed

+51
-16
lines changed

4 files changed

+51
-16
lines changed

clients/client-secrets-manager/src/commands/PutSecretValueCommand.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ export interface PutSecretValueCommandOutput extends PutSecretValueResponse, __M
5353
* same secret data, the operation succeeds but does nothing. However, if the secret data is
5454
* different, then the operation fails because you can't modify an existing version; you can
5555
* only create new ones.</p>
56-
* <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>
56+
* <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>, <code>SecretString</code>, or <code>RotationToken</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>
5757
* <p>
5858
* <b>Required permissions: </b>
5959
* <code>secretsmanager:PutSecretValue</code>.
@@ -74,6 +74,7 @@ export interface PutSecretValueCommandOutput extends PutSecretValueResponse, __M
7474
* VersionStages: [ // SecretVersionStagesType
7575
* "STRING_VALUE",
7676
* ],
77+
* RotationToken: "STRING_VALUE",
7778
* };
7879
* const command = new PutSecretValueCommand(input);
7980
* const response = await client.send(command);

clients/client-secrets-manager/src/models/models_0.ts

+19-3
Original file line numberDiff line numberDiff line change
@@ -506,6 +506,7 @@ export interface CreateSecretRequest {
506506
* <p>Either <code>SecretString</code> or <code>SecretBinary</code> must have a value, but not
507507
* both.</p>
508508
* <p>This parameter is not available in the Secrets Manager console.</p>
509+
* <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>
509510
* @public
510511
*/
511512
SecretBinary?: Uint8Array;
@@ -518,6 +519,7 @@ export interface CreateSecretRequest {
518519
* <p>If you create a secret by using the Secrets Manager console then Secrets Manager puts the protected
519520
* secret text in only the <code>SecretString</code> parameter. The Secrets Manager console stores the
520521
* information as a JSON structure of key/value pairs that a Lambda rotation function can parse.</p>
522+
* <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>
521523
* @public
522524
*/
523525
SecretString?: string;
@@ -966,7 +968,7 @@ export interface DescribeSecretResponse {
966968
KmsKeyId?: string;
967969

968970
/**
969-
* <p>Specifies whether automatic rotation is turned on for this secret.</p>
971+
* <p>Specifies whether automatic rotation is turned on for this secret. If the secret has never been configured for rotation, Secrets Manager returns null.</p>
970972
* <p>To turn on rotation, use <a>RotateSecret</a>. To turn off
971973
* rotation, use <a>CancelRotateSecret</a>.</p>
972974
* @public
@@ -1216,7 +1218,7 @@ export interface GetResourcePolicyResponse {
12161218
*/
12171219
export interface GetSecretValueRequest {
12181220
/**
1219-
* <p>The ARN or name of the secret to retrieve.</p>
1221+
* <p>The ARN or name of the secret to retrieve. To retrieve a secret from another account, you must use an ARN.</p>
12201222
* <p>For an ARN, we recommend that you specify a complete ARN rather
12211223
* 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>
12221224
* @public
@@ -1273,6 +1275,7 @@ export interface GetSecretValueResponse {
12731275
* <p>If the secret was created by using the Secrets Manager console, or if the secret value was
12741276
* originally provided as a string, then this field is omitted. The secret value appears in
12751277
* <code>SecretString</code> instead.</p>
1278+
* <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>
12761279
* @public
12771280
*/
12781281
SecretBinary?: Uint8Array;
@@ -1282,6 +1285,7 @@ export interface GetSecretValueResponse {
12821285
* through the Secrets Manager console.</p>
12831286
* <p>If this secret was created by using the console, then Secrets Manager stores the information as a
12841287
* JSON structure of key/value pairs. </p>
1288+
* <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>
12851289
* @public
12861290
*/
12871291
SecretString?: string;
@@ -1742,6 +1746,7 @@ export interface PutSecretValueRequest {
17421746
* contents of the file as a parameter. </p>
17431747
* <p>You must include <code>SecretBinary</code> or <code>SecretString</code>, but not both.</p>
17441748
* <p>You can't access this value from the Secrets Manager console.</p>
1749+
* <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>
17451750
* @public
17461751
*/
17471752
SecretBinary?: Uint8Array;
@@ -1750,6 +1755,7 @@ export interface PutSecretValueRequest {
17501755
* <p>The text to encrypt and store in the new version of the secret. </p>
17511756
* <p>You must include <code>SecretBinary</code> or <code>SecretString</code>, but not both.</p>
17521757
* <p>We recommend you create the secret string as JSON key/value pairs, as shown in the example.</p>
1758+
* <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>
17531759
* @public
17541760
*/
17551761
SecretString?: string;
@@ -1768,6 +1774,13 @@ export interface PutSecretValueRequest {
17681774
* @public
17691775
*/
17701776
VersionStages?: string[];
1777+
1778+
/**
1779+
* <p>A unique identifier that indicates the source of the request. For cross-account rotation (when you rotate a secret in one account by using a Lambda rotation function in another account) and the Lambda rotation function assumes an IAM role to call Secrets Manager, Secrets Manager validates the identity with the rotation token. For more information, see <a href="https://docs.aws.amazon.com/secretsmanager/latest/userguide/rotating-secrets.html">How rotation works</a>.</p>
1780+
* <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>
1781+
* @public
1782+
*/
1783+
RotationToken?: string;
17711784
}
17721785

17731786
/**
@@ -2109,6 +2122,7 @@ export interface UpdateSecretRequest {
21092122
* <p>Either <code>SecretBinary</code> or
21102123
* <code>SecretString</code> must have a value, but not both.</p>
21112124
* <p>You can't access this parameter in the Secrets Manager console.</p>
2125+
* <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>
21122126
* @public
21132127
*/
21142128
SecretBinary?: Uint8Array;
@@ -2118,6 +2132,7 @@ export interface UpdateSecretRequest {
21182132
* version of the secret. We recommend you use a JSON structure of key/value pairs for your secret value. </p>
21192133
* <p>Either <code>SecretBinary</code> or <code>SecretString</code> must have
21202134
* a value, but not both. </p>
2135+
* <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>
21212136
* @public
21222137
*/
21232138
SecretString?: string;
@@ -2207,7 +2222,7 @@ export interface UpdateSecretVersionStageResponse {
22072222
*/
22082223
export interface ValidateResourcePolicyRequest {
22092224
/**
2210-
* <p>This field is reserved for internal use.</p>
2225+
* <p>The ARN or name of the secret with the resource-based policy you want to validate.</p>
22112226
* @public
22122227
*/
22132228
SecretId?: string;
@@ -2306,6 +2321,7 @@ export const PutSecretValueRequestFilterSensitiveLog = (obj: PutSecretValueReque
23062321
...obj,
23072322
...(obj.SecretBinary && { SecretBinary: SENSITIVE_STRING }),
23082323
...(obj.SecretString && { SecretString: SENSITIVE_STRING }),
2324+
...(obj.RotationToken && { RotationToken: SENSITIVE_STRING }),
23092325
});
23102326

23112327
/**

clients/client-secrets-manager/src/protocols/Aws_json1_1.ts

+1
Original file line numberDiff line numberDiff line change
@@ -1172,6 +1172,7 @@ const se_CreateSecretRequest = (input: CreateSecretRequest, context: __SerdeCont
11721172
const se_PutSecretValueRequest = (input: PutSecretValueRequest, context: __SerdeContext): any => {
11731173
return take(input, {
11741174
ClientRequestToken: [true, (_) => _ ?? generateIdempotencyToken()],
1175+
RotationToken: [],
11751176
SecretBinary: context.base64Encoder,
11761177
SecretId: [],
11771178
SecretString: [],

0 commit comments

Comments
 (0)