HTTP 502 Status Code (Lambda Validation Error) - Amazon CloudFront

HTTP 502 Status Code (Lambda Validation Error)

If you’re using Lambda@Edge, an HTTP 502 status code can indicate that your Lambda function response was incorrectly formed or included invalid content. For more information about troubleshooting Lambda@Edge errors, see Testing and Debugging Lambda@Edge Functions.