HiveBrain v1.2.0
Get Started
← Back to all entries
patternMinor

LambdaA -> delay mins -> lambdaB

Submitted by: @import:stackexchange-devops··
0
Viewed 0 times
lambdabminsdelaylambdaa

Problem

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?

Solution

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

Code Snippets

Lambda1 --> SQS --> CloudWatch metric linked to an alarm --> SNS --> Lambda2

Context

StackExchange DevOps Q#1695, answer score: 2

Revisions (0)

No revisions yet.