1
00:00:00,090 --> 00:00:07,430
In this video we are going to do develop put even target on Amazon event using a SDK.

2
00:00:07,440 --> 00:00:13,440
So we are in the last use case which is a put event target in Amazon event which so for that purpose,

3
00:00:13,470 --> 00:00:15,270
please open the documentation.

4
00:00:15,270 --> 00:00:20,970
In order to do that, you can come to the documentation and search for the put target command.

5
00:00:21,060 --> 00:00:28,110
And if you open the target command, you will see that the example usage and explanation in here basically

6
00:00:28,110 --> 00:00:36,330
you can we can give the target is an API gateway code easy to event plus lambda functions as SKUs and

7
00:00:36,330 --> 00:00:36,720
so on.

8
00:00:36,990 --> 00:00:41,960
There are lots of services that we can set a target of of a event breach.

9
00:00:41,970 --> 00:00:46,020
You can see the example usage and you can see the input and output parameters.

10
00:00:46,020 --> 00:00:50,820
If you look at the input parameters, it is it is expecting the event boss name, rule name and the

11
00:00:50,820 --> 00:00:57,090
target and it is returned back to us metadata failed entities and failed enter country.

12
00:00:57,360 --> 00:00:59,190
Okay, let's start implementation.

13
00:00:59,190 --> 00:01:05,460
If you open the widget to the code, I have created target js and implement the function code is a similarly,

14
00:01:05,460 --> 00:01:11,940
we have imported required command which is the target command and passing to the entry event page client

15
00:01:11,940 --> 00:01:12,510
object.

16
00:01:12,510 --> 00:01:14,340
And here you can see the parameters.

17
00:01:14,340 --> 00:01:21,390
We don't specify the event name because this will come to default event pass team and give the rule

18
00:01:21,390 --> 00:01:26,520
that we have defined in the last video and give the target as a run and ID.

19
00:01:26,520 --> 00:01:32,670
So in the Aaron, when we are targeting the Lambda function, I have created a target function into

20
00:01:32,670 --> 00:01:37,470
our environment and copy the earn and paste into here, save this file.

21
00:01:37,470 --> 00:01:42,840
So now we are ready for the ID to put event target to our environment.

22
00:01:42,840 --> 00:01:49,170
In order to do that, run the note command and put target that just hit enter.

23
00:01:50,200 --> 00:01:54,970
So as you can see that we have successfully added target and you can see that there is no failure.

24
00:01:55,180 --> 00:02:03,970
If you go to the our Adelaide environment, open the event page, if you go to the rules and open the

25
00:02:03,970 --> 00:02:06,680
rules, you can see the targets in the target.

26
00:02:06,700 --> 00:02:11,950
This time we can see the lambda function is added to target of our rule successfully.

27
00:02:11,950 --> 00:02:15,580
Before we proceed to the next section, we should delete our resources.

28
00:02:15,610 --> 00:02:18,550
Please go to rules and select the rule.

29
00:02:18,580 --> 00:02:23,620
Click the delete button, confirm the delete message and make sure that you don't have any rules on

30
00:02:23,620 --> 00:02:26,290
Amazon event page and go to Lambda Functions.

31
00:02:26,380 --> 00:02:28,960
Select the function and delete the function.

32
00:02:28,960 --> 00:02:30,910
Confirm with the date operation.
