#4738·floci

[BUG] Lambda docs say CloudFormation mappings drop FilterCriteria, and stack-created SQS mapping delivery is untested

Author: mariotoffiaCreated Sep 30, 2026Updated Sep 30, 2026
Labelsbuglambdasqscloudformation

Service

Lambda (event source mappings) and CloudFormation

AWS API Action

AWS::Lambda::EventSourceMapping created through CreateStack and UpdateStack with an SQS event source, and the delivery that follows through the SQS poller.

Expected behavior

A stack-created SQS mapping behaves as one created through CreateEventSourceMapping:

  • FilterCriteria: a message that matches no filter is not delivered and is deleted from the queue (Lambda event filtering).
  • MaximumBatchingWindowInSeconds holds an underfilled batch open, so a message sent later joins it (batching behavior).
  • FunctionResponseTypes: ["ReportBatchItemFailures"] returns only the reported messages to the queue (partial batch responses).

The Lambda docs say which mapping properties CloudFormation and SAM forward. They also describe SQS failure handling per source, as they already do for DynamoDB Streams and Kinesis.

Actual behavior

The runtime behavior on main is correct, since #4316 forwards these properties. The docs and the test coverage have not caught up:

  1. docs/services/lambda.md still has a "Direct Lambda API only" warning. It says CloudFormation and SAM do not forward FilterCriteria, ScalingConfig or DestinationConfig. CloudFormation has forwarded all three since #4316. SAM SQS, Kinesis and DynamoDB events still forward only the queue or stream, BatchSize and Enabled, and the warning does not say that.
  2. The docs describe failure handling for DynamoDB Streams and Kinesis but not for SQS. Nothing says what a function error or a partial batch response does to the delivered messages.
  3. CloudFormationEventSourceMappingTest checks that a stack stores these properties. No test sends messages through a stack-created mapping, so a regression in the runtime path would go unnoticed.

Reproduction

bash
# A stack-created mapping with a filter, a 5 s window and ReportBatchItemFailures
aws --endpoint-url http://localhost:4566 cloudformation create-stack --stack-name esm \
  --template-body file://esm.yaml --capabilities CAPABILITY_IAM
aws --endpoint-url http://localhost:4566 sqs send-message --queue-url "$Q" --message-body '{"kind":"order"}'
aws --endpoint-url http://localhost:4566 sqs send-message --queue-url "$Q" --message-body '{"kind":"other"}'
# docs/services/lambda.md says the filter is not applied to this mapping; it is,
# but no test proves it and the docs do not describe the SQS failure semantics

Environment

  • Floci version / image tag: main at 6ca104042
  • Java SDK version (if applicable): AWS SDK for Java v2
  • How you're running Floci (Docker / native / mvn quarkus:dev): java -jar target/quarkus-app/quarkus-run.jar with Docker for Lambda