‫So here is a very cool new feature
‫from November 2019, called Lambda Destinations.
‫So, the problem is that, when we've been doing
‫asynchronous invocations or event mappers,
‫it was really hard for us to see
‫if it had failed or succeeded.
‫And if it did, to retrieve the data.
‫So the idea with destinations is to send the result
‫of an asynchronous invocation or the failure
‫of an event mapper into somewhere.
‫So where is that somewhere?
‫We'll see in a second.
‫So for asynchronous invocation,
‫we can define a destination for
‫both successful and failed events.
‫And by successful and failed,
‫we mean the processing of that event.
‫So for asynchronous invocations,
‫we have the destination of SQS, SNS, Lambda,
‫and the Amazon EventBridge bus, so cloud watch events.
‫The idea is that our lambda function
‫is invoked asynchronously for example,
‫through an S3 event.
‫And if we succeed we can send this somewhere
‫to successful event destination.
‫And if we fail we can send it to failed event destination.
‫So you may note right now that this looks a lot like
‫the DLQ setting for asynchronous invocations.
‫And so the recommendation now is that you use destinations
‫instead of the DLQ,
‫even though you can use both at the same time.
‫Why?
‫Well because the destinations are newer,
‫and they allow for more targets.
‫The DLQ just allows it to send the failures
‫into SQS and SNS,
‫but the destinations allow to send both the successes
‫and the failures into SQS, SNS, Lambda, and EventBridge.
‫Okay, that's for asynchronous invocations.
‫Now what about Event Source mapping?
‫This is only used for when you have an event batch
‫that gets discarded because we can't process it.
‫So we can, instead, send that event batch into Amazon SQS
‫or Amazon SNS,
‫which is represented by this diagram right here.
‫So we are reading from Kinesis,
‫there will be an Event Source mapping,
‫and we will try to keep on processing the data,
‫but then we don't succeed and instead of blocking
‫our entire processing of the Kinesis Data Stream,
‫we can send the discarded event batch into your
‫failed event destination.
‫And so please note that if you have an Event Source
‫mapping reading from SQS,
‫you can set either a failed destination or you can set up
‫a DLQ directly on your SQS Que.
‫It's up to you on how you want to do things.
‫So in the next lecture,
‫we'll go into destinations, do some hands on,
‫and get some practice to make
‫more sense out of this feature.
‫So I will see you in the next lecture.