feat(kms): handle RotateKeyOnDemand rotation limit (#1042)

Signed-off-by: KyounghoonJang <matkimchi_@naver.com>
This commit is contained in:
kyounghoonJang authored and GitHub committed 2026-05-30 17:49:16 -05:00
1 parent 5d3f6e9c8c
commit 650cc2280c
3 files changed
+27

No files matched your search

@@ -1027,6 +1027,22 @@ class KmsServiceTest {
assertEquals(400, ex.getHttpStatus());
}
@Test
void rotateKeyOnDemandLimitExceededThrows() {
KmsKey key = kmsService.createKey(null, REGION);
for (int i = 0; i < 25; i++) {
kmsService.rotateKeyOnDemand(key.getKeyId(), REGION);
}
AwsException ex = assertThrows(AwsException.class, () ->
kmsService.rotateKeyOnDemand(key.getKeyId(), REGION));
assertEquals("LimitExceededException", ex.getErrorCode());
assertEquals(400, ex.getHttpStatus());
assertEquals(25, kmsService.describeKey(key.getKeyId(), REGION).getOnDemandRotationCount());
}
// ── Issue #497 — HMAC key specs ─────────────────────────────────────────
@ParameterizedTest