Skip to content

Title: New serverless pattern - eventbridge-sqs-fair-queue-lambda-cdk#3056

Open
NithinChandranR-AWS wants to merge 2 commits intoaws-samples:mainfrom
NithinChandranR-AWS:NithinChandranR-AWS-feature-eventbridge-sqs-fair-queue-lambda-cdk
Open

Title: New serverless pattern - eventbridge-sqs-fair-queue-lambda-cdk#3056
NithinChandranR-AWS wants to merge 2 commits intoaws-samples:mainfrom
NithinChandranR-AWS:NithinChandranR-AWS-feature-eventbridge-sqs-fair-queue-lambda-cdk

Conversation

@NithinChandranR-AWS
Copy link
Copy Markdown

New Serverless Pattern: EventBridge to SQS Fair Queue with Lambda Consumer

Description

Deploys an EventBridge rule that routes events to an SQS fair queue, consumed by a Lambda function. Fair queues ensure equitable processing across tenants — no single tenant can monopolize the consumer.

Architecture

EventBridge PutEvents (tenant-id) → EventBridge Rule → SQS Fair Queue (per-tenant fair sharing) → Lambda Consumer

Key Features

  • FairQueueConfiguration: { NumberOfMessageGroups: 100 } via CfnQueue escape hatch
  • tenantId as message group ID for per-tenant fairness
  • DLQ with 3 retries for failed messages
  • Batch processing consumer (10 messages, 5s window)

Framework / Language

  • AWS CDK (TypeScript)
  • Lambda runtime: Node.js 20.x

Testing

  • Includes multi-tenant event publishing commands to demonstrate fair processing
  • CDK synth verified (14 CloudFormation resources)

FairQueueConfiguration is API-only as of April 2026 and not in the
CloudFormation schema. Add prominent disclaimer with CLI workaround
so users know the fair queue enablement step is manual.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants