4

I need to launch a LambdaA function and after X minutes I need to launch a LambdaB function with parameters passed from LamdaA

I have testing the following:

APIGW > LambdaA > SQS with delay > SQS can't trigger lambda functions APIGW > LambdaA > SNS > trigger LambdaB . In that case I can't add a delay

I need to do it serverless and without constant pooling for a queue or new messages.

Is there any other possibility to trigger a second lambda function with a "big" delay?

RuBiCK
  • 305
  • 1
  • 13

2 Answers2

5

Use Step Functions. They allow you to coordinate lambda functions and have an inbuilt wait state

Robo
  • 755
  • 3
  • 6
2

From your comment above:

The main difficult is launch the second lambda with a delay from the first one and without doing a pooling constantly

As using SQS queues are an option for you, you can make CloudWatch alarms which can monitor for activity in the queues, and link them up with SNS, which can be used as a trigger for LambdaB.

So, your flow can be:

Lambda1 --> SQS --> CloudWatch metric linked to an alarm --> SNS --> Lambda2
Dawny33
  • 2,816
  • 3
  • 24
  • 62