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?

posta un anno fa190 visualizzazioni
1 Risposta
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:

con risposta un anno fa

Accesso non effettuato. Accedi per postare una risposta.

Una buona risposta soddisfa chiaramente la domanda, fornisce un feedback costruttivo e incoraggia la crescita professionale del richiedente.

Linee guida per rispondere alle domande