Skip to main content

Blueprint: event-driven

Asynchronous event processing with EventBridge, SQS, and a Lambda consumer.

Architecture

Producer (any service)
│ PutEvents

EventBridge Event Bus
│ Rule: source=serviceName → SQS

SQS Queue (main)
│ visibility timeout, DLQ after N failures

Lambda Consumer
│ batch processing, partial batch failure support

Dead Letter Queue (if all retries exhausted)

AWS resources provisioned

ResourceDetails
EventBridge Event BusCustom bus named service-env-main
EventBridge RuleRoutes events by source to SQS
SQS QueueConfigurable visibility timeout, SQS-managed encryption
Dead Letter QueueMessages that fail N times land here
Lambda ConsumerNode.js 20.x, batch size 10, partial failure support
SNS Alert TopicFor alarm notifications
CloudWatch AlarmsDLQ depth, queue age, Lambda errors
Event Archive(production only) 90-day event archive for replay

Deploy

idp blueprint deploy event-driven \
--name my-service \
--env dev \
--region us-east-1

Context parameters

ParameterDefaultDescription
serviceName✅ requiredService name prefix
env✅ requireddev / staging / production
region✅ requiredAWS region
eventBusNamemainEvent bus name suffix
queueVisibilityTimeoutSeconds300SQS visibility timeout
maxReceiveCount3Retries before sending to DLQ
lambdaMemoryMb256Consumer Lambda memory
lambdaTimeoutSeconds60Consumer Lambda timeout
alarmErrorThreshold5Lambda error count to trigger alarm

Outputs

OutputDescription
EventBusNameEventBridge bus name
QueueUrlMain SQS queue URL
DlqUrlDead letter queue URL
AlertTopicArnSNS topic ARN for alerts

Publishing events (producer side)

import { EventBridgeClient, PutEventsCommand } from "@aws-sdk/client-eventbridge";

const client = new EventBridgeClient({ region: "us-east-1" });

await client.send(new PutEventsCommand({
Entries: [{
EventBusName: "my-service-dev-main",
Source: "my-service",
DetailType: "order.created",
Detail: JSON.stringify({ orderId: "123", amount: 99.99 }),
}],
}));