Is there a way to run lambda with lambda.updateFunctionConfiguration concurrently?

0

Hi I have a lambda function that I am running with updateFunctionConfiguration. The function runs great except when there is concurrency I get the error from the screenshot shown below. Is there a way to avoid getting this error while still using updateFunctionConfiguration and supporting concurrency?

await lambda .updateFunctionConfiguration({ FunctionName: "puppeteer'', Environment: { Variables: {}, }, }) .promise() Enter image description here

  • Why are you trying to update the function configuration from within the functionm? Is there inly a single instance of the function that is trying to modify the configuration?

已提问 1 年前190 查看次数
1 回答
0

No, you cannot update the configuration of an AWS Lambda function concurrently. During the update process, the function configuration is locked, and no changes can be made until the update is complete.

Instead, you can wait for the current configuration to complete by adding a random wait time and retrying again, but if you're intended to do a concurrent configuration update, that's impossible, and also it's not a best practice.

References:

已回答 1 年前

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

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

回答问题的准则