fix(ssm): reject SendCommand with more than 50 InstanceIds (#4754)

This commit is contained in:
Aymen JAMAAOUI authored and GitHub committed 2026-09-30 14:36:26 -04:00
1 parent efbd990ef7
commit b0f30ae94d
3 files changed
+79 -14

No files matched your search

@@ -45,6 +45,7 @@ public class SsmCommandService implements Resettable {
private static final Logger LOG = Logger.getLogger(SsmCommandService.class);
private static final int MIN_TIMEOUT_SECONDS = 30;
private static final int MAX_INSTANCE_IDS = 50;
static final int MAX_STDOUT_CHARS = 24000;
static final int MAX_STDERR_CHARS = 8000;
@@ -150,6 +151,12 @@ public class SsmCommandService implements Resettable {
if (instanceIds.isEmpty()) {
throw new AwsException("InvalidInstanceId", "At least one InstanceId is required.", 400);
}
if (instanceIds.size() > MAX_INSTANCE_IDS) {
throw new AwsException(
"ValidationException",
"1 validation error detected: Value at 'instanceIds' failed to satisfy constraint: Member must have length less than or equal to " + MAX_INSTANCE_IDS,
400);
}
Map<String, List<String>> parameters = parseParameters(request.path("Parameters"));
String comment = request.path("Comment").asText("");