In the previous lesson we've managed to successfully create and deploy an AWS Lambda function.
Before we progress further, in this lesson we're going to quickly take a look at AWS Console in order to understand where exactly can we find the stack that we've deployed and also execute the lambda function using a test event to make sure that it's working fine.
Instructor: [0:00] Now that our CDK stack has been deployed with this Hello Lambda function, let's take a look inside of the AWS Console to see what exactly have we deployed. To do that, go to Services and search for CloudFormation. Click over here, click on stacks -- let me close this a bit -- and click on our stack name.
[0:15] Here we can see a bunch of things. First up, in the Resources section, we can see that our stack has both an AWS Lambda function, and also an IAM role associated with that function.
[0:25] Let me click over here in order to see this function in the AWS Lambda Console. Here in the AWS Lambda Console, we can see that this function belongs to an application. Next up, if I scroll down a bit, we are going to be able to see the code of this function.
[0:37] As we can see, there's this use strict bit over here, and also a source pop, because this code has been transpired from TypeScript to JavaScript. We can see all those files over here. The hello.js is the actual function that is going to be executed, but we also can see our TypeScript file over here.
[0:53] If we scroll down even more, we can see that there are tags associated with this function. We didn't have to configure those. Those were configured for us by CDK. Right now, it is time to call this function to test that it works.
[1:05] As we can see right now, there are no triggers associated with this function. In order to call it, we are quickly going to create a test event.
[1:11] Let me click over here, click on Configure test events and I'm going to choose API gateway AWS proxy template, because this is the events type that is going to be sent to an AWS Lambda function once this function is going to get triggered via an API gateway. For instance, [inaudible] . The browser [inaudible] through a GET request.
[1:28] I'm going to call this event my-test-event. Scroll down a bit and click on Create. Next up, if I click on Test button over here, we are going to call this Lambda function and if I scroll down over here, we are going to be able to see that this function has been successfully called. We can see the status code of 200 and also a body of Hello, egghead friends.
Member comments are a way for members to communicate, interact, and ask questions about a lesson.
The instructor or someone from the community might respond to your question Here are a few basic guidelines to commenting on egghead.io
Be on-Topic
Comments are for discussing a lesson. If you're having a general issue with the website functionality, please contact us at support@egghead.io.
Avoid meta-discussion
Code Problems?
Should be accompanied by code! Codesandbox or Stackblitz provide a way to share code and discuss it in context
Details and Context
Vague question? Vague answer. Any details and context you can provide will lure more interesting answers!