fix: enforce Kinesis stream tag limit for AddTagsToStream (#8179)

This commit is contained in:
Jimmy Liu Jia authored and GitHub committed 2026-11-12 23:33:20 -04:00
1 parent a3eea94899
commit 9c0f644038
2 files changed
+36 -3

No files matched your search

@@ -286,6 +286,7 @@ public class KinesisService implements ResourceProvider {
String key = regionKey(region, streamName);
synchronized (lockFor(key)) {
KinesisStream stream = resolveStream(streamName, region);
validateTagCapacity(stream.getTags(), tags);
stream.getTags().putAll(tags);
store.put(key, stream);
}
@@ -386,6 +387,10 @@ public class KinesisService implements ResourceProvider {
throw new AwsException("InvalidArgumentException", "Invalid tag key or value", 400);
}
}
validateTagCapacity(current, added);
}
private static void validateTagCapacity(Map<String, String> current, Map<String, String> added) {
Set<String> keys = new HashSet<>(current.keySet());
keys.addAll(added.keySet());
if (keys.size() > 50 && added.keySet().stream().anyMatch(key -> !current.containsKey(key))) {