According to the AWS documentation, the AWS Parameters and Secrets Lambda Extension cannot be used outside of the handler
function.
The extension can be invoked only in the
INVOKE
phase of the the Lambda and not during theINIT
phase.
While top-level await occurs during INIT
phase
Reference: https://docs.aws.amazon.com/systems-manager/latest/userguide/ps-integration-lambda-extensions.html