Skip to content

Add Rotation Token for SecretsManager Rotation Event #520

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Feb 5, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions aws-lambda-java-events/RELEASE.CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
### January 31, 2025
`3.15.0`:
- Fix `CognitoUserPoolPreTokenGenerationEventV2` model ([#519](https://github.com/aws/aws-lambda-java-libs/pull/519))
- Add RotationToken to SecretsManagerRotationEvent ([#520](https://github.com/aws/aws-lambda-java-libs/pull/520))


### September 13, 2024
`3.14.0`:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,6 @@ public class SecretsManagerRotationEvent {
private String step;
private String secretId;
private String clientRequestToken;
private String rotationToken;

}
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,8 @@ public abstract class SecretsManagerRotationEventMixin {
// needed because Jackson expects "clientRequestToken" instead of "ClientRequestToken"
@JsonProperty("ClientRequestToken") abstract String getClientRequestToken();
@JsonProperty("ClientRequestToken") abstract void setClientRequestToken(String clientRequestToken);

// needed because Jackson expects "rotationToken" instead of "RotationToken"
@JsonProperty("RotationToken") abstract String getRotationToken();
@JsonProperty("RotationToken") abstract void setRotationToken(String rotationToken);
}
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,9 @@ public void testLoadSecretsManagerRotationEvent() {
assertThat(event)
.returns("123e4567-e89b-12d3-a456-426614174000", from(SecretsManagerRotationEvent::getClientRequestToken))
.returns("arn:aws:secretsmanager:eu-central-1:123456789012:secret:/powertools/secretparam-xBPaJ5", from(SecretsManagerRotationEvent::getSecretId))
.returns("CreateSecret", from(SecretsManagerRotationEvent::getStep));
.returns("CreateSecret", from(SecretsManagerRotationEvent::getStep))
.returns("8a4cc1ac-82ea-47c7-bd9f-aeb370b1b6a6", from(SecretsManagerRotationEvent::getRotationToken));
;
}

@Test
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"Step" : "CreateSecret",
"SecretId" : "arn:aws:secretsmanager:eu-central-1:123456789012:secret:/powertools/secretparam-xBPaJ5",
"ClientRequestToken" : "123e4567-e89b-12d3-a456-426614174000"
"ClientRequestToken" : "123e4567-e89b-12d3-a456-426614174000",
"RotationToken": "8a4cc1ac-82ea-47c7-bd9f-aeb370b1b6a6"
}