I have deployed AWS stack with a Lambda function and an API gateway. After deployment I tested Lambda function independently and it works fine but when I invoke it using AWS API Gateway, it fails with `
Internal Error: 502
I looked at cloudwatch logs and it says
Endpoint response body before transformations: null
I am returning my response from Lambda (Python 3.6) in following way -
body = {
"message": "Success!!"
}
response = {
"statusCode": 200,
"headers": {
"content-type": "application/json"
},
"body": json.dumps(body),
"isBase64Encoded": False,
}
return response