Component 07

Event Consumer

Buffer and process service events with isolated queues and retries.

Status

Available module

Deployment scope

Primary + DR ready

Example version constraint

~> 1.0

Review published versions ↗

What it deploys

The resources this component creates, and how they connect. Drag to pan, scroll to zoom.

Usage example

Inputs in, outputs out. Illustrative wiring, not a standalone deployment.

Supply AWS provider aliases and an Event Bus module named events. Configure a processor separately if your service needs Lambda execution. Configure provider requirements and credentials in your root module; check the documentation for all required inputs and version changes.

main.tf
module "order_events" {
  source = "pomo-studio/event-consumer/aws"
  version = "~> 1.0"

  name             = "order-processor"
  bus_name_primary = module.events.bus_name_primary
  bus_name_dr      = module.events.bus_name_dr
  event_pattern = {
    source      = ["com.myapp.orders"]
    detail-type = ["OrderCreated"]
  }
}

Key inputs

  • name
  • bus_name_primary
  • bus_name_dr
  • event_pattern
  • enable_dr
  • enable_dlq

Useful outputs

  • queue_arn_primary
  • dlq_arn_primary
  • rule_arn_primary
  • lambda_arn_primary

What you get

01

Reliable buffering

SQS absorbs bursts and separates event delivery from processing speed.

02

Failure isolation

Each consumer owns its rule, queue, retry policy, and dead-letter queue.

03

Optional processor

Wire a Lambda processor only when the service needs one.

  • Materialized View

    Precompute a read-optimized projection so queries stay fast without recomputing on every request.

  • CQRS

    Separate the write model from the read model so each can be shaped for its own job.

  • Event-Driven Fan-out

    Publish one event and let independent consumers react, without the producer knowing who they are.

Built with

  • EventBridge
  • SQS
  • Lambda
  • CloudWatch
  • Terraform