In this video, we are going to learn learn the asynchronous invocation and the Lambda Destinations.
So far, we have seen that we can add trigger to lambda function.
But now we also see on the right hand side, which is the eighth destination of our lambda function,
which is the lambda destinations.
We can see these triggers and destinations when creating a lambda function from the management console.
Let me explain.
What is Lambda destinations?
Lambda can define destinations.
One invoke asynchronous way.
We can set destinations on success or on faith events after invocation is done.
So we can also configure Lambda to send an invocation record to another services.
Lambda supports the destinations for asynchronous invocation.
You can see the image on the slide.
So basically we can designate the incoming invocation to Amazon, asks Amazon Sass a lambda and event.
So the invocation record contains details about the request and the response.
In JSON format, we can configure separate destinations for events that are processed successfully and
events that fail all processing attempts.
Alternatively, we can configure an Amazon case or Amazon SMS topic as a data queue for discarded events
for that digital cuz lambda only sends the content of the event without detail about the response.
So we set that we can configure destinations for asynchronous invocation on lambda function in order
to send the records of asynchronous invocation to another services.
We can add a destination to our lambda function.
That means we can configure separate destinations for event that fail processing or the events that
are successful process it like error handling settings.
We can configure destinations on a function, on a version or an alias.
So you can see the image on the slide that shows a function that is processing asynchronous invocations
when the function returns a success response or exit without throwing any error.
Lambda sends a record of the invocation to an event.
Event plus.
So when an error fails all processing atom's lambda sends an invocation record to Amazon q.
You can see the image in here.
We are processing the asynchronous invocation.
So that's why there's the event queue, which is the internal event of lambda function.
When the invocation successfully finished, it can be redirect or destination to the successful event
to the Amazon event page.
But if the invocation got exception in two times, so that means the invocation record is processing
the own fail process, which is the Amazon queue in the failure event destinations.
In order to send events to the destination lambda function needs to additional permissions.
We should add the policy with the required permission to our lambda function execution rules.
Each destination service requires a different permissions.
You can see that, for example, Amazon is required to send message permission SNS required to publish
lambda, required to invoke function event which required the events, put event policy and permissions
should be included or in execution role on the lambda function.
As you can see that we have launched a lambda asynchronous invocation and the lambda destination.