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?

asked a year ago182 views
1 Answer
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:

answered a year ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions