1
00:00:00,360 --> 00:00:06,330
In this video, we are going to test a lambda function with a management console.

2
00:00:06,570 --> 00:00:13,110
So basically in order to test our function, we will invoke our lambda function using the sample event

3
00:00:13,110 --> 00:00:15,570
data provided in the management console.

4
00:00:15,810 --> 00:00:17,220
Let's get started.

5
00:00:17,640 --> 00:00:22,590
In order to invoke our function, go to function page and choose the test tab.

6
00:00:23,840 --> 00:00:30,530
So in this section you can choose the great event and we should provide the event name.

7
00:00:31,650 --> 00:00:36,430
And if you scroll down you can see the template name is a helloworld and sample image.

8
00:00:36,480 --> 00:00:40,320
JSON is in here key one, two, three and one, two, three.

9
00:00:41,280 --> 00:00:48,390
So if you scroll up, we basically configured our test event and we can save and click the test button.

10
00:00:51,610 --> 00:00:55,600
After Click to taste button, you can see the execution result in here.

11
00:00:55,720 --> 00:01:02,410
Basically lambda function is runs our function with the test method and the function handle receives

12
00:01:02,410 --> 00:01:05,590
and then process the sample event which we send in here.

13
00:01:06,580 --> 00:01:13,000
So the execution execution result shows the execution status as a succeed, we can see that we have

14
00:01:13,000 --> 00:01:16,590
succeeded tested in order to view the function execution result.

15
00:01:16,600 --> 00:01:21,060
Please expand this detailed tab and you can see all the details.

16
00:01:21,070 --> 00:01:23,890
We can see the log links open the local up.

17
00:01:23,890 --> 00:01:27,880
You can see in here if you click right click and open window.

18
00:01:28,210 --> 00:01:33,610
Basically we are going to see the logs, this particular execution.

19
00:01:33,700 --> 00:01:41,140
But I would like to continue in this page and if you scroll down under the summary section, this is

20
00:01:41,140 --> 00:01:47,440
the show of the key information reported in the output section and in the log output section we can

21
00:01:47,440 --> 00:01:53,080
see the logs and lambda generates all the log output in here for each invocation.

22
00:01:53,080 --> 00:01:59,620
Lambda generates these log output that we can see in this box and the function writes logs in the cloud.

23
00:01:59,620 --> 00:02:02,380
Watch so we can see the logs in here.

24
00:02:02,380 --> 00:02:09,550
You can see the details as a duration and billing duration, memory size, maximum size in iteration

25
00:02:09,550 --> 00:02:10,260
and so on.

26
00:02:10,270 --> 00:02:15,580
So now let's test a few more or lambda function.

27
00:02:15,880 --> 00:02:21,760
So basically I'm going to close this execution and sanity test again.

28
00:02:22,670 --> 00:02:23,390
Yes.

29
00:02:23,390 --> 00:02:25,100
Let me click the test again.

30
00:02:25,100 --> 00:02:32,660
And we have sent three times this invitation payload to the lambda and we should see three locations

31
00:02:32,660 --> 00:02:36,590
on the Amazon Cloud Watch logs in order to see logs on the cloud watch.

32
00:02:36,590 --> 00:02:41,430
We can see the monitor top in here, click the monitor tab and click this.

33
00:02:41,480 --> 00:02:49,430
We've logs in Cloud Watch and now we will see these three location in the cloud watch logs on the lambda

34
00:02:49,640 --> 00:02:50,300
function.

35
00:02:50,420 --> 00:02:52,400
Please click these log three.

36
00:02:53,540 --> 00:02:58,100
And as you can see that we have seen three times invoked our function.

37
00:02:58,100 --> 00:03:04,690
And when we invoked our function, we have start, look, and after that we are going to log logging

38
00:03:04,700 --> 00:03:09,830
some info information value, one value to add value to and return back to what you want information.

39
00:03:10,070 --> 00:03:14,600
So this is the first invocation and this is the second invocation and this is the third invocation.

40
00:03:15,230 --> 00:03:21,170
So as you can see that we have right the function and just invoke by testing function on the management

41
00:03:21,170 --> 00:03:23,300
console by clicking the test button.

42
00:03:23,660 --> 00:03:31,550
And after that we will see these logs under the under the Amazon cloud watch logs and we don't set any

43
00:03:31,550 --> 00:03:38,210
server configuration, don't end set any environment, just write the code and execute a list is automatically

44
00:03:38,210 --> 00:03:42,980
deploy and scale horizontally at behind the scenes so it is fully serverless.
