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.
Create your function and API gateway with SAM - Amazon Web Services (AWS) Tutorial
From the course: Learning Amazon Web Services Lambda
Create your function and API gateway with SAM
- [Instructor] In the previous videos, you have created the SAM project, and it came with a function with an API gateway. You have run it locally, you have tried all around. So with this video, let's create a new function from scratch and see how we can do that. The first step is to go to your template.yaml, and in here, we are going to add another function. So you have here the HelloWorldFunction, and underneath, do the same indentation, because we are with yaml, we are going to make a new function. I want to make a function that will allow us to roll a dice. For now, we are going to start with a six-side dice, a traditional one. So let's make RollADiceFunction, and here, we are going to type the type of this resource, and this will be a function. Then we are going to put some properties for the function. The first one is to have the URI, and this is where the code will be. So the code for the function will be in…