From the course: Learning Amazon Web Services Lambda

Unlock the full course today

Join today to access over 24,400 courses taught by industry experts.

Lambda functions with AWS SAM

Lambda functions with AWS SAM

- [Instructor] In the previous video, you created SAM project that come with Lambda function. Also, we look at the different parts, this template YAML, how the function was created there, we look at the app JS file and what was inside. In this episode, we will build and run locally this application from the function and from the API, so you can test it. So let's start by building this application. The first command we need to run is sam build. When sam build run, then you can see inside your directory that you will have a new folder called .aws-sam. And here it will be all the build information. In order to run build and to do the local testing, you need to have Docker install and running at this time. After you have build, now we can do a local invoke. We are going to invoke the Lambda function from our computer with a test event. For this demo, we are going to use the test event that SAM provide for us. So if you go to your…

Contents