When Lambda is invoked by SNS, will there always be just 1 record?

RckMrkr picture RckMrkr · Nov 13, 2015 · Viewed 7.4k times · Source

When receiving events in Lambda from SNS the outer structure of the event will look somewhat like: { "Records": [...] }

In all the tutorials I have seen there has only ever been 1 record in the records field.

Is it safe to make the assumption that the "Records"-array will only ever contain 1 item?

Answer

omuthu picture omuthu · Nov 13, 2015

Each SNS notification will contain not more than one message.

Refer Reliability section in SNS FAQ : https://aws.amazon.com/sns/faqs/

Having said that, each lambda function trigger will have just a single record