0
votes

I have the following scenario. EC2, AWS Lambda (anything) is publishing a message to SNS topic that has AWS Lambda as a consumer. I wonder what would be a behavior if I have my AWS Lambda consumer scaled into two instances running at the same time (let's say a lot of events). SNS event will be processed twice by two instances of the same AWS Lambda or just once?

Regards

1
A "lambda consumer scaled into two instances" is a phrase that does not parse correctly, as lambda is neither a "consumer" of SNS nor does Lambda have "instances." Lambda containers launch in parallel, automatically, to handle the offered workload, one concurrent event per container. I think more clarification is required of what you are describing. - Michael - sqlbot
Hi. Lambda function is subscribed to SNS topic - docs.aws.amazon.com/sns/latest/dg/sns-lambda.html . And regarding "instances" I meant Lambda containers running at the same time with the same Lambda code. Scenario is very basic. Subscribed to SNS topic Lambda has a logic to send a user specific push notifications. So my question is basically if it is possible that multiple push notifications will be sent because there are multiple containers with the same subscribed Lambda running at the same time invoked by the same event published to SNS topic - rjozefowicz

1 Answers

0
votes

No, an SNS message will only run in one Lambda container*

  • SNS is ALOD so there is a potential for receiving the same message twice, whether there is one Lambda instance or two.