Skip to Main Content
Implementing AWS: Design, Build, and Manage your Infrastructure
book

Implementing AWS: Design, Build, and Manage your Infrastructure

by Yohan Wadia, Rowan Udell, Lucas Chan, Udita Gupta
January 2019
Intermediate to advanced content levelIntermediate to advanced
690 pages
16h
English
Packt Publishing
Content preview from Implementing AWS: Design, Build, and Manage your Infrastructure

Handler

As discussed briefly in the earlier chapter, the handler is basically a function that Lambda calls first for execution. A handler function is capable of processing incoming event data that is passed to it as well as invoking other functions or methods from your code.

In this book, we will be concentrating a lot of our code and development on Node.js; however, the programming model remains more or less the same for the other supported languages as well.

A skeleton structure of a handler function is shown as follows:

exports.myHandler = function(event, context, callback) {    
  // Your code goes here. 
  callback(); 
} 

Here, myHandler is the name of your handler function. By exporting it, we make sure that Lambda knows which function it has ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

AWS Account Setup Best Practices

AWS Account Setup Best Practices

Chad Smith
AWS Administration Cookbook

AWS Administration Cookbook

Rowan Udell, Lucas Chan

Publisher Resources

ISBN: 9781788835770OtherErrata Page