Iva
Iva

Reputation: 367

What happens if I have 2 CloudWatch events that trigger the same lambda function at the same time?

I have 1 Lambda function which is configured to submit a given job to AWS Batch via a boto3 call. The lambda function gets triggered by a CloudWatch event, where the CloudWatch event passes the job information as a dictionary.

There are many CloudWatch events and each of them is for a different job. It is possible for more than one CloudWatch events to trigger the Lambda function at the same time. What will happen in this case? Will the Lambda function fail to submit some of the jobs or all of them?

Upvotes: 5

Views: 3234

Answers (1)

F_SO_K
F_SO_K

Reputation: 14809

By default a Lambda function will run up to 1000 concurrent executions.

So to answer your question, assuming your Lambda is configured to execute on each Cloud Watch event, your Lambda function will be running twice, both at the same time.

Upvotes: 3

Related Questions