I'm using lambda@edge + cloudfront to do some image resizes etc. My origin is S3 bucket.
ISSUE: When I try to call for an object inside s3 via cloudfront over browser I get the above error (picture). it even happens when I use just a test function(below).
how I call/query it: My s3 is set as origin, so I just use my cloudfront Domain Name d5hbjkkm17mxgop.cloudfront.net and add s3 path /my_folder/myimage.jpg
browser url used: d5hbjkkm17mxgop.cloudfront.net/my_folder/myimage.jpg
exports.handler = (event, context, callback) => {
var request = event.Records[0].cf.request;
console.log(event);
console.log("\n\n\n");
console.log(request);
callback(null, request);
};
I'm pretty sure that request is an object - have no idea why is this happening. If testing in aws console all works - so it has to be an cloudfront/lambda interface error - because lambda is not even invoked (no new log entrie being generated).
I also have an access error from cloudfront:
2018-01-08 12:40:20 CDG50 855 62.65.189.38 GET d3h4fd56s4fs65d4f6somxgyh.cloudfront.net /nv1_andrej_fake_space/98f741e0b87877c607a6ad0d2b8af7f3ba2f949d7788b07a9e89453043369196 502 - Mozilla/5.0%2520(X11;%2520Ubuntu;%2520Linux%2520x86_64;%2520rv:57.0)%2520Gecko/20100101%2520Firefox/57.0 - - LambdaValidationError usnOquwt7A0R7JkFD3H6biZp21dqnWwC5szU6tHxKxcHv5ZAU_g6cg== d3hb8km1omxgyh.cloudfront.net https 260 0.346 - TLSv1.2 ECDHE-RSA-AES128-GCM-SHA256 LambdaValidationError HTTP/2.0
Any ideas?
EDITED: semicolon