AWS Parameters and Secrets Lambda Extension throwing BadRequestException

0

I have been trying to use the AWS Parameters and Secrets Lambda Extension to access parameters from the parameter store using this guide https://docs.aws.amazon.com/systems-manager/latest/userguide/ps-integration-lambda-extensions.html

The problem is that if I try to access the parameter store(which runs on http://localhost:2773) as soon as the lambda starts up then I get a 400 BadRequestException error from the parameter store with the message not ready to serve traffic, please wait

If I add a delay of 100ms before accessing the parameter store then it works fine and successfully fetches the parameters. The 100ms delay is a blocker for using it in any production environment.

Is there a way to use the extension without introducing any wait times for initialization?

Thanks

  • I am also facing the same issue. I am trying to cache the database connection inside init method (using Java for Lambda function development. Trying to load DB connection in handler's constructor). DB credentials are stored in Secret manager. The 'Secret Manager Lambda Layer' is used to access Secret manager.

Sameer
已提问 1 年前268 查看次数
没有答案

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则