in monitoring/remoteRun.ts [14:31]
async function invokeInRegion(
region: string,
functionName: string,
stage: string,
): Promise<InvokeCommandOutput> {
const payload: CustomScheduleEventContent = {
region: region,
stage: stage,
};
const command = new InvokeCommand({
FunctionName: functionName,
LogType: 'Tail',
Payload: Buffer.from(JSON.stringify(payload)),
});
const client = new LambdaClient({ region: region });
return await client.send(command);
}