In this video we are going to do develop put even target on Amazon event using a SDK.
So we are in the last use case which is a put event target in Amazon event which so for that purpose,
please open the documentation.
In order to do that, you can come to the documentation and search for the put target command.
And if you open the target command, you will see that the example usage and explanation in here basically
you can we can give the target is an API gateway code easy to event plus lambda functions as SKUs and
so on.
There are lots of services that we can set a target of of a event breach.
You can see the example usage and you can see the input and output parameters.
If you look at the input parameters, it is it is expecting the event boss name, rule name and the
target and it is returned back to us metadata failed entities and failed enter country.
Okay, let's start implementation.
If you open the widget to the code, I have created target js and implement the function code is a similarly,
we have imported required command which is the target command and passing to the entry event page client
object.
And here you can see the parameters.
We don't specify the event name because this will come to default event pass team and give the rule
that we have defined in the last video and give the target as a run and ID.
So in the Aaron, when we are targeting the Lambda function, I have created a target function into
our environment and copy the earn and paste into here, save this file.
So now we are ready for the ID to put event target to our environment.
In order to do that, run the note command and put target that just hit enter.
So as you can see that we have successfully added target and you can see that there is no failure.
If you go to the our Adelaide environment, open the event page, if you go to the rules and open the
rules, you can see the targets in the target.
This time we can see the lambda function is added to target of our rule successfully.
Before we proceed to the next section, we should delete our resources.
Please go to rules and select the rule.
Click the delete button, confirm the delete message and make sure that you don't have any rules on
Amazon event page and go to Lambda Functions.
Select the function and delete the function.
Confirm with the date operation.