Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
// Alice.ts
import aws from 'aws-sdk';
export function main(event: any, context: any, callback: Function) {
new aws.Lambda().invoke({
FunctionName: process.env.BobFunction!,
Payload: JSON.stringify({message: "Hi!. I'm Alice."})
}, (error: Error, data: any) => {
const response = JSON.parse(data.Payload);
console.log('FromBob', error || response)
callback(error);
});
}
// Bob.ts
export function main(event: any, context: any, callback: any) {
console.log('FromAlice', event)
callback(null, {message: "Hi! I'm Bob. Nice to meet you!"});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.