Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

87
Views
Is callback required in AWS Lambda handler?

What is the callback doing in lambda handler? It seems to be using sns variable and I intend to modify the variables.

exports.handler = function(event, context, callback) {
   console.log("AWS lambda and SNS trigger ");
   console.log(event);
   const sns = event.Records[0].Sns.Message;
   console.log(sns)
   callback(null, sns);   
};

I'm trying to modify the code to something like this and not sure what I should pass for callback. I also want to trigger another lambda and pass these new variables to it.

exports.handler = function(event, context, callback) {
   console.log("AWS lambda and SNS trigger ");
   console.log(event);
   const sns_NameSpace = event.Records[0].Sns.Message.Trigger.Namespace;
   const sns_ApiId = event.Records[0].Sns.Message.Trigger.Dimensions.value;
   const sns_MetricName = event.Records[0].Sns.Message.Trigger.MetricName;
   console.log(sns_ApiId + '_' + sns_MetricName)
   console.log(sns_NameSpace)   
   
   callback(null, sns); // Wondering what I should pass for the callback.
   
};
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

If you have configured SNS -> Lambda trigger, you don't need to do anything to the callback. SNS sends a message to a subscriber (in this case a Lambda function) exactly once and does not wait for a response from the subscriber.

And what exactly do you mean by 'another lambda'?

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!