Я прочитал этот документ: https://docs.aws.amazon.com/en_us/lambda/latest/dg/nodejs-prog-model-logging.html и сделал это лямбда:
exports.handler = async (event) => {
// TODO implement
// const response = {
// statusCode: 200,
// body: JSON.stringify('Hello from Lambda!'),
// };
console.log(123321);
console.log(event.Records[0].cf.response);
console.log(event.Records[0].cf.request);
console.log(JSON.stringify(event.Records[0].cf));
console.log(event);
console.log(arguments);
//Get contents of response
const response = event.Records[0].cf.response;
//Return modified response
return response;
};
Это работает (логи отправляет в CloudWatch), когда я использую «тест» с поддельной моделью, но когдаЯ добавляю триггер CloudFront, и журналы запросов на отправку не отправляются ни на один CloudWatch.
![Lambda function configuration](https://i.stack.imgur.com/1XRY8.png)
- как получить реальный (с производства)
event
объект из лямбды - как отправлять / получать журналы из лямбды, которая запускается CloudFront?