From the course: Learning Amazon Web Services Lambda

Unlock the full course today

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

Solution

Solution

(upbeat music) - [Lecturer] In this video, I want to go over my solution of the second challenge. So the first thing you want to do is in your project create the function and the API gateway. So for that, we are going to template.yaml and we are going to create a new function resource. If you want, you can reutilize the one that we created previously. But let's start from scratch. RollADiceWithSidesFunction. I'm very original with the names. Type: AWS::Serverless::Function. Then we want to have some properties, the CodeUri and that will be roll-dice-sides. And the Handler: app.lambdaHandler. The runtime will be node 18. And then we'll have an event that is an API gateway with the method get and the path roll as the instruction says. So with this, now we have created our infrastructure, the function, and the API gateway. The next thing we need to do is to create in our directory, we need to create the roll a dice…

Contents