fix(rds): DescribeDBParameterGroups returns DBParameterGroupNotFound for an unknown name (#7066)

* fix(rds): DescribeDBParameterGroups returns DBParameterGroupNotFound for an unknown name

* refactor(rds): reuse getDbParameterGroup for the named DescribeDBParameterGroups lookup

The named branch built its own copy of the DBParameterGroupNotFound
exception. getDbParameterGroup does the same region-scoped lookup and
throws the same error, so call it instead. The test now also pins the
error message.
This commit is contained in:
Allen Sanborn authored and GitHub committed 2026-10-31 14:53:13 -04:00
1 parent b4cd98fb61
commit 9512de107f
2 files changed
+23 -3

No files matched your search

@@ -7524,11 +7524,10 @@ public class RdsService implements Resettable, ResourceProvider {
public Collection<DbParameterGroup> listDbParameterGroups(
String filterName, String region) {
String effectiveRegion = effectiveRegion(region);
if (filterName != null && !filterName.isBlank()) {
DbParameterGroup group = findParameterGroupForRegion(filterName, effectiveRegion);
return group != null ? List.of(group) : List.of();
return List.of(getDbParameterGroup(filterName, region));
}
String effectiveRegion = effectiveRegion(region);
Map<String, DbParameterGroup> unique = new LinkedHashMap<>();
List<DbParameterGroup> storedGroups;
if (parameterGroups instanceof AccountAwareStorageBackend<DbParameterGroup> aware) {