1
00:00:00,210 --> 00:00:06,570
In this video, we are going to create rule in Amazon event page with using a device management console.

2
00:00:07,240 --> 00:00:14,530
So when we are creating a rule in Amazon event which we will use and specify an action to take one event

3
00:00:14,560 --> 00:00:17,920
which receive an event that match the event pattern in the rule.

4
00:00:18,100 --> 00:00:24,580
So one event, match event, we sent the event to the specified target and triggered the action defined

5
00:00:24,580 --> 00:00:25,270
in the rule.

6
00:00:25,720 --> 00:00:29,630
So one service in our account emit the event.

7
00:00:29,650 --> 00:00:32,800
It always goes to default event plus for our account.

8
00:00:32,830 --> 00:00:38,710
In order to write a rule that makes event from a the services in our account, we must associate it

9
00:00:38,710 --> 00:00:40,120
with the default event pass.

10
00:00:40,480 --> 00:00:42,030
So let's create a new rule.

11
00:00:42,040 --> 00:00:45,490
If you open the activation console, click the create rule.

12
00:00:46,250 --> 00:00:51,230
And you can see the rule definition has five steps in the visit.

13
00:00:51,320 --> 00:00:58,520
So basically it will watch for certain events and then route them to the targets that we choose so we

14
00:00:58,520 --> 00:01:03,970
can create a rule that performs an action automatically when another actions happen.

15
00:01:03,980 --> 00:01:09,680
Or we can set a rule that performs an adverse action regularly on a scheduled basis.

16
00:01:09,710 --> 00:01:15,770
You can see that there is a rule type's the rule with an event pattern or rule with the schedule.

17
00:01:16,340 --> 00:01:16,970
Okay.

18
00:01:16,970 --> 00:01:23,450
So basically we should define a rule, detail, name, description, event, pass and rule type.

19
00:01:23,450 --> 00:01:26,520
And also the second step is world event pattern.

20
00:01:26,540 --> 00:01:28,740
The third step is select targets.

21
00:01:28,760 --> 00:01:34,790
So if you see the targets, there are lots of services can be target from Amazon event page, we will

22
00:01:34,790 --> 00:01:36,230
select Lambda function.

23
00:01:36,230 --> 00:01:41,840
So for that purpose, before we create a rule, let's create a lambda function which will be the target

24
00:01:41,840 --> 00:01:43,300
service for our Amazon event.

25
00:01:43,370 --> 00:01:47,180
Natural for that purpose will is go to lambda function.

26
00:01:48,470 --> 00:01:55,250
And create the function the GB, the R target function gives the name is a target function and leave

27
00:01:55,250 --> 00:01:58,400
as it is for all configurations and click the create function.

28
00:02:01,460 --> 00:02:03,200
So this is going to.

29
00:02:04,150 --> 00:02:09,280
Our target lambda function that we triggered from the Amazon event page.

30
00:02:10,070 --> 00:02:10,820
Okay.

31
00:02:10,880 --> 00:02:13,040
Target function is created successfully.

32
00:02:13,070 --> 00:02:18,320
Now we can go back to the event page and continue our visit that creating a rule definition.

33
00:02:18,320 --> 00:02:20,340
So I'm going to create a new rule.

34
00:02:20,360 --> 00:02:22,480
The name of the rule is the checkout rule.

35
00:02:22,490 --> 00:02:24,020
You can think that we are.

36
00:02:24,020 --> 00:02:27,650
Check out the basket and this is the rule of the checkout.

37
00:02:27,650 --> 00:02:31,310
And if you scroll down, the event path is default event.

38
00:02:31,310 --> 00:02:37,190
Plus, since we don't create any custom events, we can set a default event pass and you can see the

39
00:02:37,430 --> 00:02:40,810
rule types with the event pattern or the schedule.

40
00:02:40,820 --> 00:02:42,710
So there are two rule types.

41
00:02:42,980 --> 00:02:48,270
We can choose event pattern that makes this rule is triggered when an event matching the pattern.

42
00:02:48,290 --> 00:02:53,660
Of course, we can choose a predefined pattern that makes a certain type of event from the certain services,

43
00:02:53,660 --> 00:02:55,610
or we can create a custom pattern.

44
00:02:55,790 --> 00:03:01,060
Even if you choose a predefined pattern, you can then edit the pattern, customize it.

45
00:03:01,070 --> 00:03:07,910
So in this selection we can set an event pattern and we can edit the event pattern that match the the

46
00:03:07,910 --> 00:03:10,430
rule and after that rule to the target system.

47
00:03:10,430 --> 00:03:17,110
But in cycle we can choose to make this rule that is triggered regularly on the schedule base.

48
00:03:17,120 --> 00:03:23,960
We can use a simple fixed rate schedule that triggered every certain number of minutes, hours or weeks.

49
00:03:23,960 --> 00:03:25,910
So this is the schedule part.

50
00:03:25,910 --> 00:03:30,530
So basically we will use the rule with event pattern in our case.

51
00:03:30,530 --> 00:03:37,340
And after that we will understand how we can create event pattern in the next video of the step to.
