In this video, we are going to create rule in Amazon event page with using a device management console.
So when we are creating a rule in Amazon event which we will use and specify an action to take one event
which receive an event that match the event pattern in the rule.
So one event, match event, we sent the event to the specified target and triggered the action defined
in the rule.
So one service in our account emit the event.
It always goes to default event plus for our account.
In order to write a rule that makes event from a the services in our account, we must associate it
with the default event pass.
So let's create a new rule.
If you open the activation console, click the create rule.
And you can see the rule definition has five steps in the visit.
So basically it will watch for certain events and then route them to the targets that we choose so we
can create a rule that performs an action automatically when another actions happen.
Or we can set a rule that performs an adverse action regularly on a scheduled basis.
You can see that there is a rule type's the rule with an event pattern or rule with the schedule.
Okay.
So basically we should define a rule, detail, name, description, event, pass and rule type.
And also the second step is world event pattern.
The third step is select targets.
So if you see the targets, there are lots of services can be target from Amazon event page, we will
select Lambda function.
So for that purpose, before we create a rule, let's create a lambda function which will be the target
service for our Amazon event.
Natural for that purpose will is go to lambda function.
And create the function the GB, the R target function gives the name is a target function and leave
as it is for all configurations and click the create function.
So this is going to.
Our target lambda function that we triggered from the Amazon event page.
Okay.
Target function is created successfully.
Now we can go back to the event page and continue our visit that creating a rule definition.
So I'm going to create a new rule.
The name of the rule is the checkout rule.
You can think that we are.
Check out the basket and this is the rule of the checkout.
And if you scroll down, the event path is default event.
Plus, since we don't create any custom events, we can set a default event pass and you can see the
rule types with the event pattern or the schedule.
So there are two rule types.
We can choose event pattern that makes this rule is triggered when an event matching the pattern.
Of course, we can choose a predefined pattern that makes a certain type of event from the certain services,
or we can create a custom pattern.
Even if you choose a predefined pattern, you can then edit the pattern, customize it.
So in this selection we can set an event pattern and we can edit the event pattern that match the the
rule and after that rule to the target system.
But in cycle we can choose to make this rule that is triggered regularly on the schedule base.
We can use a simple fixed rate schedule that triggered every certain number of minutes, hours or weeks.
So this is the schedule part.
So basically we will use the rule with event pattern in our case.
And after that we will understand how we can create event pattern in the next video of the step to.