From the course: AWS for Developers: Data-Driven Serverless Applications with Kinesis (2019)

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Trigger a Lambda with a new SQS message

Trigger a Lambda with a new SQS message - Amazon Web Services (AWS) Tutorial

From the course: AWS for Developers: Data-Driven Serverless Applications with Kinesis (2019)

Start my 1-month free trial

Trigger a Lambda with a new SQS message

- [Instructor] So now we have the queue, and we have put a message in the queue, and now we need to trigger a new lambda from that message. So, let's go to serverless.yml, and let's go to the functions and to the bottom of that, under the notifyExternalParties. And let's create a new function that will be notifyDeliveryCompany. And this one will be the one that gets triggered when there is a new message in the queue. And we will create a new method in the handler, notifyDeliveryCompany. And this one will trigger when there's a new event. In the sqs: queue with the arn: that we are getting from here. So, this is CloudFormation notation to get a resource and to construct the ARN, so you can also use these in your permissions, if you want. And here you need to use the same name that is in the definition of the CloudFormation. So, there are many ways to construct the Arn. Another thing we need to do is to decide in which batch we are going to process the amount of messages. So, we want to…

Contents