0

I know about the provisioned instance configuration for lambda functions. Is it possible to run multiple instances of a lambda function on a timer basis? I know generally we use CloudWatch Events for this, just not how to specify multiple instances. To be clear, I want something like: I want 10 instances of my function to run at "2022-02-02 10:10:10".

4
  • 1
    Sounds like an XY problem - why would you want 10 separate instances? Commented Feb 3, 2022 at 11:57
  • Because I need to have multiple workers Commented Feb 3, 2022 at 11:58
  • If this is a continuation of some of your previous questions like this one: stackoverflow.com/questions/70863723/… then I think you need to go back and reevaluate using SQS and setting up the SQS queue as an event source for Lambda. You wouldn't need to setup these CloudWatch schedules at all. Commented Feb 3, 2022 at 14:25
  • No, it's a different issue, but thanks for asking and for commenting on it! Commented Feb 3, 2022 at 14:27

1 Answer 1

1

Some options:

  • Create 10 identical CloudWatch events
  • Create a new Lambda that is triggered by your single CloudWatch event. The new Lambda would invokes your worker Lambda function 10 times asynchronously
  • Create a Step Functions state machine that triggers 10 Lambda invocations, and trigger the step function on a schedule
Sign up to request clarification or add additional context in comments.

3 Comments

Thanks, but although these are hypothetical options, I don't think some of them are practical. I am interested, though, in step functions, it might be an option, yes, I'll have to dig into that.
I'm not sure why any of them are necessarily impractical. If you were using something like Terraform then the first option would be a matter of adding a single line of code to your Infrastructure as Code. The 2nd option is something I see people doing fairly regularly.
Yes, maybe I'm wrong, maybe they are all viable options.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.