I have a lambda function (say A) which needs to invoke another lambda function (say B). But that other function (B) should not run at the time of invoke but should run at the time defined by A.
Given below is how I'm trying to invoke function B inside function A.
function startRecording(startTime, roomName) {
const payload = {
roomName
}
const param = {
FunctionName: 'consult-classroom-api-dev-StartRecording',
InvocationType: "RequestResponse",
Payload: JSON.stringify(payload)
}
return new Promise((resolve, reject) => {
lambda.invoke(param,(err, data) => {
if (err) {
reject(err);
} else {
let payload = JSON.parse(data.Payload);
let payloadBody = JSON.parse(payload.body);
resolve(payloadBody);
}
}
);
});
}
So I have the start time with me. Need a way to invoke function B at that time. Can anyone suggest a way or work around if this is not possible in aws?