Chapter 5. Building Serverless Applications
So far we’ve talked a lot about Lambda functions—how to program them, how to package and deploy them, how to process input and output, etc. One important aspect to Lambda, however, that we haven’t covered much so far, is that Lambda functions are rarely invoked directly from code we write in a different system. Instead, for the vast majority of usages of Lambda, we configure an event source, or trigger, that is another AWS service, and let AWS invoke our Lambda function for us.
We looked at a couple of examples of this in “What Does a Lambda Application Look Like?”:
-
To implement an HTTP API, we configure AWS API Gateway as the event source.
-
To implement file processing, we configure S3 as the event source.
There are many different AWS services that directly integrate with Lambda, and even more that integrate indirectly. This means that we can build serverless applications, using Lambda as the compute platform, that can perform a vast range of tasks.
In this chapter, we look at how to tie event sources to Lambda and then explore how to build specific types of application with this technique. Along the way, you’ll learn more about how to architect, build, package, and deploy Lambda-based applications, building on our knowledge from the previous chapter.
If you haven’t done so already, you’ll likely want to download the example source code before trying any of the examples in this chapter.
Lambda Event Sources
As you just learned, ...
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.
Read now
Unlock full access