The aws-dynamodb-refdb plugin can be build as a regular ‘in-tree’ plugin. That means that is required to clone a Gerrit source tree first and then to have the plugin source directory into the /plugins path.

Additionally, the plugins/external_plugin_deps.bzl file needs to be updated to match the aws-dynamodb-refdb plugin one.

git clone --recursive
cd gerrit
git clone "" plugins/aws-dynamodb-refdb
ln -sf plugins/aws-dynamodb-refdb/external_plugin_deps.bzl plugins/.
bazelisk build plugins/aws-dynamodb-refdb

The output is created in