- [Rick] Thanks to Jon, you should now understand the value proposition of Lambda and the idea of running functions in response to events. Lambda's pretty awesome, and we're going to use it in multiple ways throughout the rest of these exercises. As usual, we'll start simple and enhance our Lambda function as we progress through the exercises. Whenever you use Lambda, you always need to think about what it's going to do and what it's going to interact with. In this one, we're going to replace API Gateway, you know the mock you built earlier, with a function that returns a temperature. Now, this doesn't make any real difference to our website, but what it will do is create a base from which we can add advanced functionality a bit later on. Once we have this mock Lambda in place, swapping out the code for more elaborate functionality, it's easy. We know we want to return a temperature, but what about the other thing we need to consider. What will Lambda interact with? Well, often when you write code, you might need to debug and push information to a logging system. As Jon talked about, we have CloudWatch for this. So naturally, that is one service that our Lambda function is going to need to interact with. We call that an "execution permission." But there's even something else that we have to consider. API Gateway needs to wake up Lambda, but Lambda is not executing API Gateway, right? So, we need something ever so slightly different here to wire this up correctly. We need an invocation permission on Lambda to say that it can be triggered by API Gateway. Of course, we could put the permissions on the API Gateway end and say that it's allowed to wake up Lambda, but for this lab, we're just going to create an invocation permission on the Lambda function, because it's super easy to do in the console. So, once you have your Lambda function that returns the temperature, regardless of city, mimicking what you had with the API Gateway, and it has permissions to write logs and be awoken by API Gateway, we can test it in our front end website. I hope you're starting to see the big picture here, piecing together serverless components on top of each other, to create an end-to-end solution. Naturally, we need to make this work with real data instead of dummy data, but all in good time. Let's get this Lambda thing working first. Good luck with this lab. You know, I think you'll like Lambda. It's really cool once you start working with it.