Я пытаюсь вызвать шлюз API из aws лямбды, которая запускается очередью sqs. И мой шлюз API вызывает другую лямбда-функцию для получения некоторой информации.
Но когда я отправляю сообщение из моей очереди sqs, лямбда выполняется правильно, но вызов моего api gaetway не выполняется.
Мой код ниже:
var https = require('https');
const URL = process.env.API_GATEWAY_URL;
exports.handler = async (event, context, callback) => {
console.log("hello");
https.get(URL, function (result) {
console.log('Success, with: ' + result.statusCode);
context.done(null);
}).on('error', function (err) {
console.log('Error, with: ' + err.message);
context.done("Failed");
});
};
А вот журналы, которые у меня есть в cloudwatch:
START RequestId: 4eeccd03-b7d2-5ef c -aedb-8c3a14411101 Версия: $ LATEST 2020-04-21T13: 14: 01.524Z 4eeccd03-b7d2-5ef c -aedb-8c3a14411101 INFO привет END RequestId: 4eeccd03-b7d2-5ef c -aedb-8c3a14411101
Но я ожидаю что-то подобное:
START RequestId: 4eeccd03-b7d2-5ef c -aedb-8c3a14411101 Версия: $ LATEST 2020-04-21T13: 14: 01.524Z 4eeccd03-b7d2-5ef c -aedb-8c3a14411101 Привет 2020 -04-21T13: 14: 01.524Z 4eeccd03-b7d2-5ef c -aedb-8c3a14411101 Успешно, с: 200 END RequestId: 4eeccd03-b7d2-5ef c -aedb-8c3a14411101
Или:
START RequestId: 4eeccd03-b7d2-5ef c -aedb-8c3a14411101 Версия: $ LATEST 2020-04-21T13: 14: 01.524Z 4eeccd03-b7d2-5ef c -aedb-8c3a14411101 ИНФОРМАЦИЯ hello 2020-04-21T13: 14: 01.524Z 4eeccd03-b7d2-5ef c -aedb-8c3a14411101 Ошибка, с: message_error END RequestId: 4eeccd03-b7d2-5ef c -aedb 811 * aab4 8 1024 *
И все мои лямбды в одном и том же VP C.
Есть идеи?