1
00:00:00,300 --> 00:00:06,740
In this video, we are going to invoke our lambda function with the event JSON object using the click

2
00:00:06,810 --> 00:00:07,500
commands.

3
00:00:07,950 --> 00:00:12,870
So in this video, we are going to invoke and test our newly created lambda function with passing even

4
00:00:12,870 --> 00:00:16,020
JSON file using the same commands.

5
00:00:16,260 --> 00:00:19,830
Before we start, we can check the reference documentation examples.

6
00:00:19,860 --> 00:00:24,990
If you come to the reference documentation, if you scroll down, you can see the Invoke method.

7
00:00:25,080 --> 00:00:29,760
If you click the Invoke method, you can see the options and configurations.

8
00:00:29,760 --> 00:00:33,480
When we are running the Lambda Invoke Command.

9
00:00:33,730 --> 00:00:37,310
You can see the invocation type, log type payload and so on.

10
00:00:37,320 --> 00:00:43,230
And if you scroll down, you can see examples of how we can use a based on the invoke command with passing

11
00:00:43,230 --> 00:00:44,880
the payload and object.

12
00:00:45,350 --> 00:00:47,040
Okay, let's get started.

13
00:00:47,070 --> 00:00:55,140
So for that purpose, open the Visual Studio code and create a new folder which is the Lecture 50 and

14
00:00:55,140 --> 00:01:00,810
please create an event JSON file that we are going to passing one invoking our newly created function.

15
00:01:00,930 --> 00:01:07,080
And under the command text file you can see in here in the multi-line characters, I'm going to use

16
00:01:07,080 --> 00:01:14,280
these select command which is a lambda invoke passing the function name as my dash function tool, which

17
00:01:14,280 --> 00:01:16,740
is the newly created function in the last video.

18
00:01:16,860 --> 00:01:23,010
And we should pass the CLI binary format base 64 and payload should be the event adjacent in the same

19
00:01:23,010 --> 00:01:26,790
directory and response JSON will be create after on this command.

20
00:01:26,820 --> 00:01:33,090
Please copy this command and paste to the related directory and hit enter.

21
00:01:33,960 --> 00:01:39,570
And this will be the invoke or lambda function synchronously and here you can find the response is that's

22
00:01:39,570 --> 00:01:46,530
called 200 success and if you open the response that JSON you can see the body is a hello from lambda

23
00:01:46,530 --> 00:01:47,220
function.

24
00:01:47,250 --> 00:01:53,340
We can also verify these function invocation from the our management console.

25
00:01:53,340 --> 00:02:01,380
Please open the my function to and come to monitor and we've closed watch logs as we already assign

26
00:02:01,380 --> 00:02:05,270
these policy in our Lambda X execution world.

27
00:02:05,280 --> 00:02:08,430
We can see the logs under the Amazon Cloud Watch logs.

28
00:02:08,430 --> 00:02:15,930
You can see that we are logging the incoming event JSON object, which is the key value from our evaluation

29
00:02:15,930 --> 00:02:16,440
file.

30
00:02:16,650 --> 00:02:17,400
Okay.

31
00:02:17,730 --> 00:02:22,550
If you remember that we have logged the incoming event in the lambda function code.

32
00:02:22,560 --> 00:02:26,250
So that's why we should see these evaluation data into Amazon cloud.

33
00:02:26,250 --> 00:02:27,000
Which logs?
