feat(athena): support DeleteWorkGroup action (#1213)

* feat(athena): support DeleteWorkGroup action

* feat(athena): validate WorkGroup name and block deletion of primary workgroup

* fix: validate WorkGroup name pattern in DeleteWorkGroup per AWS constraints

---------

Co-authored-by: mansiverma897993 <vmansi756@gmaail.com>
This commit is contained in:
MAN$I VERMAandmansiverma897993 authored and GitHub committed 2026-06-10 23:52:08 -05:00
1 parent 2b466bf980
commit e35d30bc42
2 files changed
+87

No files matched your search

@@ -94,6 +94,16 @@ public class AthenaJsonHandler {
String tableName = request.get("TableName").asText();
yield Response.ok(Map.of("TableMetadata", athenaService.getTableMetadata(catalog, database, tableName))).build();
}
case "DeleteWorkGroup" -> {
String wg = request.path("WorkGroup").asText(null);
if (wg == null || !wg.matches("[a-zA-Z0-9._-]{1,128}")) {
throw new AwsException("InvalidRequestException", "WorkGroup is required.", 400);
}
if ("primary".equals(wg)) {
throw new AwsException("InvalidRequestException", "The primary workgroup cannot be deleted.", 400);
}
yield Response.ok(Map.of()).build();
}
default -> throw new AwsException("InvalidAction", "Action " + action + " is not supported", 400);
};
}