1
00:00:00,270 --> 00:00:05,850
In this video, we are going to see a number of typical events and test templates.

2
00:00:06,600 --> 00:00:12,930
Most land based applications use a combination of resources for different requirements about storage,

3
00:00:12,930 --> 00:00:16,680
API management and integrating with other systems and services.

4
00:00:17,130 --> 00:00:22,020
In these applications, Lambda is connecting between services, providing business logic to transform

5
00:00:22,020 --> 00:00:24,150
data that moves between services.

6
00:00:24,780 --> 00:00:30,900
So we said that the service applications, mostly using a combination of several services that integrate

7
00:00:30,900 --> 00:00:34,050
with custom code, run on the lambda functions.

8
00:00:34,230 --> 00:00:41,220
So Lambda integrates with all these other services to invoke function or take other actions.

9
00:00:41,580 --> 00:00:45,210
There are some common use cases that you can also see on the slide.

10
00:00:45,240 --> 00:00:49,640
For example, invoke a function in response to the source lifecycle events.

11
00:00:49,650 --> 00:00:52,160
For example, Amazon S3 storage.

12
00:00:52,170 --> 00:00:59,400
If you upload the Amazon S3 storage, it could be triggered at the Lambda function and the photo different

13
00:00:59,400 --> 00:01:00,180
devices.

14
00:01:00,390 --> 00:01:04,260
And the second use case could be to respond to incoming HTTP requests.

15
00:01:04,290 --> 00:01:11,310
You can see the web application and the application user click the button and this will be invoke the

16
00:01:11,340 --> 00:01:12,570
API Gateway API.

17
00:01:12,570 --> 00:01:15,720
Gateway will run the lambda function on behind the scenes.

18
00:01:15,860 --> 00:01:23,310
Another case could be the consume event from the queue and as case could be pulling from the lambda

19
00:01:23,700 --> 00:01:24,480
locations.

20
00:01:24,480 --> 00:01:27,250
And also we can run a function on a cycle.

21
00:01:27,270 --> 00:01:34,170
We can run the IWC lambda with scheduled events on Amazon event which depending on which service you

22
00:01:34,170 --> 00:01:39,000
are using with lambda, the invocation works with the different events and objects.

23
00:01:39,000 --> 00:01:46,470
So that means S3 triggered events and API gateway events and space events is different with each other.

24
00:01:46,680 --> 00:01:52,470
Our lambda function should be developed according to incoming event object from other services.

25
00:01:53,770 --> 00:01:59,110
So now I'm going to show you example test templates which we can simulate to trigger a lambda function

26
00:01:59,110 --> 00:02:00,880
from other sources.

27
00:02:01,360 --> 00:02:06,370
Please open the measurement console and open the one of the lambda function.

28
00:02:07,000 --> 00:02:15,070
And if you go to the test section, maybe you remember we have create a new test templates and if you

29
00:02:15,070 --> 00:02:19,210
click the create new test template and give the random name.

30
00:02:19,450 --> 00:02:23,140
If you scroll down, you can see there is some templates in here.

31
00:02:23,140 --> 00:02:29,090
If you click this dropdown, you can see the potential incoming events in here.

32
00:02:29,110 --> 00:02:31,120
For example, I would like to show.

33
00:02:31,810 --> 00:02:32,530
History.

34
00:02:33,300 --> 00:02:37,630
But throughout the city you can see that a three put event.

35
00:02:37,650 --> 00:02:45,900
If you think that your Amazon S3 object resources will trigger to your function, this is an example

36
00:02:45,900 --> 00:02:48,330
incoming event JSON to the lambda function.

37
00:02:48,330 --> 00:02:55,080
You can see that we have records and in every record we have some details about the S3 object, bucket

38
00:02:55,080 --> 00:02:59,190
name and so on is the same way you can search for the case.

39
00:02:59,190 --> 00:03:05,040
If the case triggered to your lambda function, you can see the records and in the records you can see

40
00:03:05,040 --> 00:03:09,480
the details of the body, message, ID, even source and so on.

41
00:03:09,480 --> 00:03:17,730
So at the same way you can search a SNS topic notification and here the is about the SNS topic notification

42
00:03:17,730 --> 00:03:22,110
and you can see API gateway a list proxy.

43
00:03:22,140 --> 00:03:26,760
This will be the API gateway invocation to a lambda.

44
00:03:26,760 --> 00:03:32,310
You can get the body resource and pet HTTP method information in the incoming events object.

45
00:03:32,310 --> 00:03:39,480
So this is very good resource to see and simulate your function to incoming event from different sources.

46
00:03:39,480 --> 00:03:44,940
We're checking different templates in the test section of the lambda function, so we should develop

47
00:03:44,940 --> 00:03:48,390
lambda functions according to the typical service and our use cases.
