Mysql query returns 502 error for lambda function

Hi,

Is there a reason you’re using express? You don’t need it to accomplish what you’re doing in this function. However, it shouldn’t be preventing your query from working.

Have you tried adding logging for the error that you’re throwing? it doesn’t look like you’re catching it anywhere, or doing anything with it. If the query is throwing then the error might tell you what you need to do to fix it.