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?

demandé il y a un an190 vues
1 réponse
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:

répondu il y a un an

Vous n'êtes pas connecté. Se connecter pour publier une réponse.

Une bonne réponse répond clairement à la question, contient des commentaires constructifs et encourage le développement professionnel de la personne qui pose la question.

Instructions pour répondre aux questions