awslambdanewlambda

AWS Lambda - Invoke new Lambda

Summary: How to use a lambda to invoke a new lambda
Date: Around 2022
Refactor: 20 February 2025: Checked links and formatting.

It would be better to do this using Step Functions but sometimes quick and dirty is good enough. See the code below to invoke a new Lambda function onze your current one is done.

// Lambda Variables
var aws = require('aws-sdk');
var lambda = new aws.Lambda({
  region: 'eu-west-1' //change to your region
});
 
// Invoke nextlambda if you don't want to use Step Functions
 
// function invoke Email
function invokeLambdaEmail(requestBody, callback, error){
    var params = {
        FunctionName: 'sendoutEmail',
        InvocationType: 'Event',
        Payload: JSON.stringify(requestBody, null, 2)
      };
      lambda.invoke(params, function(err, data) {
        if (err) console.log(err, err.stack); // an error occurred
        else     console.log(data);           // successful response
      });
}
awslambdanewlambda.txt · Last modified: by sjoerd

Exception: Git command failed to perform periodic pull: From https://dev.azure.com/getshiftingcom/Documentation/_git/knowledge * branch main -> FETCH_HEAD fatal

Exception: Git command failed to perform periodic pull: From https://dev.azure.com/getshiftingcom/Documentation/_git/knowledge * branch main -> FETCH_HEAD fatal

An unforeseen error has occured. This is most likely a bug somewhere. It might be a problem in the gitbacked plugin.

More info has been written to the DokuWiki error log.