Things are going well but I am for some reason getting a 502 ‘internal server error’ when performing the UPDATE even though my Item is indeed getting updated just fine in the DynamoDB Table. Has anyone encountered this?
Pretty sure @bni is on the right track here - it sounds like the response object.
Look at the code you linked, all the errors have console.error lines before them, so since you’re not seeing those errors (and your DDB operation is working) it pretty much has to be the response object format being wrong. Log out the response object and verify it before you callback(null, response) line to be sure.
I was facing similar issue.
In my case, Lambda was timing out in 6 seconds. Lambda was making ‘DDB Update’ request but because of 3 ‘Provision Write Capacity Units’, ‘DDB update operation’ was taking more time and during this time lambda was getting timed out.
Solutions: I increased ‘Provision Write Capacity Units’ of DDB to required.
‘DDB Update’ operation was taking more time because in my case I was making number of ‘DDB Update’ operations concurrently so.