Book Image

AWS Lambda Quick Start Guide

By : Markus Klems
Book Image

AWS Lambda Quick Start Guide

By: Markus Klems

Overview of this book

AWS Lambda is a part of AWS that lets you run your code without provisioning or managing servers. This enables you to deploy applications and backend services that operate with no upfront cost. This book gets you up to speed on how to build scalable systems and deploy serverless applications with AWS Lambda. The book starts with the fundamental concepts of AWS Lambda, and then teaches you how to combine your applications with other AWS services, such as AmazonAPI Gateway and DynamoDB. This book will also give a quick walk through on how to use the Serverless Framework to build larger applications that can structure code or autogenerate boilerplate code that can be used to get started quickly for increased productivity. Toward the end of the book, you will learn how to write, run, and test Lambda functions using Node.js, Java, Python, and C#.
Table of Contents (8 chapters)

Lambda Function with S3 Event Input

Previously, we created a synchronous Lambda function that takes the string as input and returns the string as output. Now, we are going to create an asynchronous Lambda function that can be invoked through S3 events, and test the function with a dummy event that can upload a file to S3 and see if the function is triggered by the create-object event.

Open the project that we have created. Let's add a new Lambda function handler to the project. Click on the little orange box and select New AWS Lambda Function. We will create a new function handler name, S3FunctionHandler; use the default input type that is already selected, S3 Event; and as leave the output type as object:

Click on Finish. This will create some boilerplate code with the Lambda function handler that takes an S3 event as input:

Let's deploy the new function. Right click...