Now that we've got a AWS Lambda function built, let's go through and invoke it locally and look at a couple of different ways we can test it. First, we can do this command here, which is sam local invoke, and this invokes the Lambda function as long as you live inside of the correct directory. Notice that I'm not inside of the Lambda directory, so I need to change into there. Let's go ahead and do that. Let's look at this AWS Lambda and it's inside of hello world, and now if I type in sam local invoke, it will actually be able to look inside this template, pull a container and then test the function itself. It doesn't test the API. Now if I want to test the API, essentially the API Gateway around this command which is sam local start API. Let's go ahead and clear the screen, run this, and this is great because it runs a web service here. In fact, this is the thing that I want to call, which is the 127.0.0.1:3000/hello. I'm going to copy that. I'm going to open up a new terminal here, and then I'm going to run the curl commands. Curl, I'll go through and run this and we see that the payload is successful. If I go to the output, you can see here as well that 200 request was made to this application. There's a couple of really clever ways to test things out locally, and it's really a great convenience for local development. Let's go ahead and kill this. I'll do Control C and look at a few other things here. API Gateway, when it's in the AWS Cloud, let's look at that. Let's look at CloudWatch logs, and let's also look at the correct IAM security settings to make sure that we understand what those do. First off, if we go to this function here and we look at the actual monitoring tab here. It gives us the ability to look at a high-level overview of everything that's happening in this particular function. Now, one of the things that we can do is we can actually save view logs in CloudWatch, and if you've invoked the function inside of AWS, then it'll allow you to look at those invocation. We can see here that these are all of the invocations that have occurred, and because there's no print statements, there's no output, but if we wanted to add additional information to this function, we can go through and do that. The other thing that we'll look at is also the API Gateway. If I go through here and I again go back to the function itself, go through here. Notice that the trigger is where the API Gateway is set. AWS Lambda has many different triggers, IoT, Kafka, CloudFront, these are all different things. It can be hooked in to the AWS Lambda ecosystem. In this particular instance, it's going to be API Gateway. If I click on it, it'll show me this hello-world function. The last thing that we'll take a look at is the security settings, and the reason why this is important. If we go through here and we look at this environment, we look at permissions. Here, the reason why this is important is that in particular, if you wanted to make sure that this could do other things, you would have to change your setting here that allowed it to do other actions like for example, call let's say AWS, DynamoDB, or to call S3 or to invoke SQS. These are all things that could be edited by allowing this particular function permission to access other resources. These are where you would go through and change those functions, and this in particular is the statement ID that allows you to go through and edit those permissions. There's a couple of different ways that you can do this. You can do this again by action or you could also do this by resource. But in general, it's important to know that these are abilities that your particular function has, and this shows you all of those ability. Again, for making more advanced applications, you would need to add a different role.