1 Answers
3
Accepted Answer
As you are using node.js I think the issue is that the function returns before the function finished updating the database. Once the function returns, the Lambda execution environment is frozen and it will be unfrozen when the next request is received.
You should either update the DB using a synchronous mode, i.e., use await
when updating the DB, or make sure that the context.callbackWaitsForEmptyEventLoop
is set to true
. See more information here.
Relevant questions
Return a custom header from lambda authorizer in API-gateway (HTTP api)
asked 2 months agoHow to use postgres rest api in AWS
asked 3 months agoApiGateway REST not respecting Lambda alias
Accepted Answerasked 8 months agoServerless lambda rest api not updating database properly
Accepted Answerasked a month agoDeploy Lambda Function and API Gateway REST
asked 6 months agoLambda queries do not reflect the database state
asked 2 years agoComaptibility between REST and HTTP API
asked 3 months agoIs it possible to send json data in body of GET method defined in API Gateway REST API ?
Accepted Answerasked 5 months agoCan lambda know the specific attribute which changed in the dynamo db table update, when a lambda is triggered by dynamo db table update item??
asked 5 months agoWhy can't I find my RDS database from my lambda function?
asked 5 months ago