Build serverless event-driven architectures on AWS
Well-Architected serverless and event-driven AWS guidance: seven design principles with CDK/TypeScript code and MCP-verified facts.
Why it matters
Design and implement production-ready serverless applications on AWS using Well-Architected Framework principles, with comprehensive guidance on Lambda functions, event-driven patterns, state orchestration, and resilient microservices architectures.
Outcomes
What it gets done
Generate idempotent Lambda functions with proper error handling and retry logic
Design event-driven workflows using EventBridge, SNS, SQS, and Step Functions orchestration
Implement saga patterns and distributed transactions with compensating actions
Build real-time stream processing pipelines with Kinesis and DynamoDB Streams
Install
Add it to your toolbox
Run in your project directory:
curl -fsSL https://spark.entire.vc/get/ag-aws-serverless-eda | bash Overview
AWS Serverless & Event-Driven Architecture
An AWS serverless and event-driven architecture skill covering seven Well-Architected design principles with CDK/TypeScript code for orchestration, idempotency, and failure handling. Use when building serverless Lambda applications, event-driven architectures, or orchestrating multi-service transactions on AWS.
What it does
Comprehensive guidance for building serverless applications and event-driven architectures on AWS based on the AWS Well-Architected Framework's serverless lens, requiring all AWS facts to be verified via MCP tools before answering, with an aws-mcp-setup dependency auto-loaded for tool setup. It documents seven Well-Architected serverless design principles with full TypeScript/CDK before-and-after code for each: functions should be speedy, simple, and singular, with single-purpose handlers, minimized cold starts, and provisioned concurrency only when needed; design for concurrent requests rather than total volume, using DynamoDB pay-per-request or provisioned-with-autoscaling billing modes; share nothing, since runtime environments are short-lived, using persistent storage like S3 or DynamoDB instead of the local /tmp filesystem; assume no hardware affinity and design for portability via environment variables; orchestrate with Step Functions state machines rather than chaining Lambda invocations directly; use events such as S3 notifications or EventBridge rules to trigger transactions instead of synchronous request/response, for loose coupling and independent scaling; and design for failures and duplicates via idempotent operations that check a DynamoDB record before processing and mark it processed after, plus exponential-backoff retry logic. It covers error handling with SQS partial-batch-failure responses, mandatory Dead Letter Queue configuration with a CloudWatch alarm on DLQ depth, and observability setup via X-Ray tracing and Lambda Powertools environment variables. It points to six deeper reference files covering event-driven patterns (EventBridge routing, SQS queue processing, SNS/SQS pub-sub fan-out, Step Functions saga pattern, DynamoDB Streams event sourcing), serverless architecture patterns (API-driven microservices, Kinesis stream processing, async SQS task processing, EventBridge scheduled jobs, webhook processing), security best practices, observability best practices, performance optimization, and deployment best practices, plus an explicit warning to let CDK auto-generate resource names rather than hardcoding them, for reusability across parallel deployments.
When to use - and when NOT to
Use it when building serverless applications with Lambda, designing event-driven architectures, implementing microservices patterns, creating asynchronous processing workflows, orchestrating multi-service transactions, building real-time data pipelines, implementing saga patterns for distributed transactions, or designing for scale and resilience.
Inputs and outputs
Input is a serverless or event-driven architecture requirement - a Lambda function, an event pipeline, an orchestration workflow. Output is CDK/TypeScript infrastructure and handler code following the seven Well-Architected principles, for example an idempotent SQS handler:
export const handler = async (event: SQSEvent) => {
for (const record of event.Records) {
const orderId = JSON.parse(record.body).orderId;
const existing = await dynamodb.getItem({
TableName: process.env.TABLE_NAME,
Key: { orderId },
});
if (existing.Item) {
console.log('Order already processed:', orderId);
continue;
}
await processOrder(orderId);
await dynamodb.putItem({
TableName: process.env.TABLE_NAME,
Item: { orderId, processedAt: Date.now() },
});
}
};
Integrations
Built on AWS CDK, via a companion aws-cdk-development dependency's CDK MCP server, and the AWS Documentation MCP for verifying service features and API specs; targets Lambda, Step Functions, EventBridge, SQS/SNS, DynamoDB including Streams, Kinesis, X-Ray, and Lambda Powertools, with external references to the AWS Well-Architected Serverless Lens and ServerlessLand.com.
Who it's for
Cloud engineers building serverless or event-driven AWS systems who need Well-Architected-aligned, MCP-verified patterns for orchestration, idempotency, and failure handling rather than ad hoc Lambda chaining.
FAQ
Common questions
Discussion
Questions & comments · 0
Sign In Sign in to leave a comment.