Modify your function like this:
const response = {
status: '302',
statusDescription: 'Found',
headers: {
location: [{
key: 'Location',
value: 'http://<domainname>/something/root.html',
}],
'x-lae-region': [ { key: 'x-lae-region', value: process.env.AWS_REGION } ],
},
};
What this does is capture the region where your lambda function is running -- it will show us-east-1 during test, but show an accurate value once deployed.
Responses captured by your browser, curl, etc., will now include x-lae-region: some-aws-region to indicate the region linked to the edge where your specific requests are being handled. Check the logs for that specific region -- you should see logs and invocations there.
Also note that for an Origin Request (but not Viewer Request) trigger, CloudFront caches the response generated by Lambda, so the function will only be invoked when there is a cache miss. If CloudFront has cached the response, the trigger will not fire -- the cached response is served without contacting the origin. If you make this function live and you don't see the change in the responses, then you are almost certainly looking at cached responses, and will want to do an invalidation.