In this video, we are going to invoke our lambda function with the event JSON object using the click
commands.
So in this video, we are going to invoke and test our newly created lambda function with passing even
JSON file using the same commands.
Before we start, we can check the reference documentation examples.
If you come to the reference documentation, if you scroll down, you can see the Invoke method.
If you click the Invoke method, you can see the options and configurations.
When we are running the Lambda Invoke Command.
You can see the invocation type, log type payload and so on.
And if you scroll down, you can see examples of how we can use a based on the invoke command with passing
the payload and object.
Okay, let's get started.
So for that purpose, open the Visual Studio code and create a new folder which is the Lecture 50 and
please create an event JSON file that we are going to passing one invoking our newly created function.
And under the command text file you can see in here in the multi-line characters, I'm going to use
these select command which is a lambda invoke passing the function name as my dash function tool, which
is the newly created function in the last video.
And we should pass the CLI binary format base 64 and payload should be the event adjacent in the same
directory and response JSON will be create after on this command.
Please copy this command and paste to the related directory and hit enter.
And this will be the invoke or lambda function synchronously and here you can find the response is that's
called 200 success and if you open the response that JSON you can see the body is a hello from lambda
function.
We can also verify these function invocation from the our management console.
Please open the my function to and come to monitor and we've closed watch logs as we already assign
these policy in our Lambda X execution world.
We can see the logs under the Amazon Cloud Watch logs.
You can see that we are logging the incoming event JSON object, which is the key value from our evaluation
file.
Okay.
If you remember that we have logged the incoming event in the lambda function code.
So that's why we should see these evaluation data into Amazon cloud.
Which logs?