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.
Return a custom header from lambda authorizer in API-gateway (HTTP api)asked 2 months ago
How to use postgres rest api in AWSasked 3 months ago
ApiGateway REST not respecting Lambda aliasAccepted Answerasked 8 months ago
Serverless lambda rest api not updating database properlyAccepted Answerasked a month ago
Deploy Lambda Function and API Gateway RESTasked 6 months ago
Lambda queries do not reflect the database stateasked 2 years ago
Comaptibility between REST and HTTP APIasked 3 months ago
Is it possible to send json data in body of GET method defined in API Gateway REST API ?Accepted Answerasked 5 months ago
Can 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 ago
Why can't I find my RDS database from my lambda function?asked 5 months ago