Skip to content

Add EventBridge source to queues #284

Open
@adamjq

Description

Start from the Use-case

First of all, thanks for this project 🙌 it's a great concept. This a feature request to enhance the Queue construct that might benefit others.

Adding an SQS queue and DLQ between AWS EventBridge and AWS Lambda can be useful for:

  1. Improved storage and ability to retry if failures occur
  2. Protecting a microservice from large bursts of traffic by throttling the delivery of messages

See EventBridge to SQS: Building fault-tolerant microservices

As a producer, I'd like to publish events to AWS EventBridge and not have to add messages to a queue directly.

This pattern has already been implemented in AWS SAM, and as a custom CDK construct.

Example Config

The Serverless Framework already provides an EventBridge connection for functions, and I could see this feature using the same approach https://www.serverless.com/framework/docs/providers/aws/events/event-bridge

For example:

constructs:
  my-queue:
    type: queue
    events:
      - eventBridge:
          pattern:
            detail-type:
              - payments.InvoicePaid

Implementation Idea

The existing CDK construct could be used as a starting point for inspiration https://github.com/awslabs/aws-solutions-constructs/tree/main/source/patterns/%40aws-solutions-constructs/aws-eventbridge-sqs

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions