for some reason my AWS lambda returns a 502 error no matter how i change my response.
Sun Mar 25 03:39:12 UTC 2018 : Endpoint response body before transformations: {"status":200,"body":"{\"Items\":[],\"Count\":0,\"ScannedCount\":1}","isBase64Encoded":false,"headers":{"content-type":"application/json"}}
I have made sure to stringify my body and add the status, headers, and isBase64Encodeded properties. I have tried varying the headers and making them empty as well.
Why do i get this error?
here is the lambda code:
var response = {
status : 200,
body : JSON.stringify(data),
isBase64Encoded : false,
headers : {"content-type" : "application/json"}
}
console.log(response)
callback(null, response);