- Home
- Skills
- APIs & Backend
- AWS Serverless: Lambda, DynamoDB & Events Done Right
Works with the AI Agents you already use
AWS Serverless: Lambda, DynamoDB & Events Done Right
AWS Serverless makes your agent build and review like a seasoned AWS architect.
Free
AWS Serverless: Lambda, DynamoDB & Events Done Right
Example session with this skill installed
Review our serverless backend (CDK, TypeScript). We get random duplicate orders, some messages disappear, and the AWS bill doubled last month.
- Read your context and instructions
- Compiled the aws serverless
Architecture found
API Gateway REST -> createOrder Lambda -> (sync invoke) chargePayment Lambda -> (sync invoke) notify Lambda; SQS fulfilment -> worker Lambda; DynamoDB orders (provisioned). 14 functions, x86, 1,024 MB each.
Findings (severity-ranked)
| # | Severity | Finding | Evidence | Fix |
|---|---|---|---|---|
| 1 | critical | Duplicate orders: client retries on 504 re-create orders; no idempotency | createOrder.ts:41, API GW 29 s timeout vs 3 chained Lambdas | Idempotency key header + Powertools Idempotency (DynamoDB table) |
| 2 | critical | Messages lost: SQS has no DLQ; worker throws on a bad record, so the whole batch retries until expiry | queue.ts, no deadLetterQueue, no partial batch response | DLQ (maxReceiveCount 5) + reportBatchItemFailures + DLQ alarm |
| 3 | high | Visibility timeout 30 s = function timeout 30 s -> messages reprocessed while still running | queue.ts:12 | 180 s (6x) |
| 4 | high | Sync Lambda -> Lambda chain doubles duration cost and latency | createOrder.ts:58 | Step Functions Express or EventBridge event |
| 5 | high | Cost: CloudWatch Logs = 41 % of bill (DEBUG level, never-expire retention); NAT Gateway for DynamoDB traffic | Cost Explorer | INFO level, 30-day retention, DynamoDB gateway endpoint |
| 6 | medium | dynamodb:* on * in 9 roles | IAM | Scoped grants via CDK grantReadWriteData |
| 7 | medium | Scan on orders list endpoint | listOrders.ts:20 | GSI ORG#id / created_at + Query |
Applied (PR-ready, dev stage)
- Idempotency on
createOrder, payment and notify moved to a Step Functions Express workflow - DLQ + partial batch failures + alarms; visibility 180 s
- arm64 + Power Tuning: memory 1,024 -> 512 MB on 11 functions with no latency change
- Log retention 30 days, INFO level; DynamoDB gateway endpoint
cdk synthclean, 38 unit tests passing, deployed todev
Estimated monthly cost
$1,940 -> ~$870 (-55 %), mainly logs, NAT and Lambda duration.
Not touched: production stack and shared IAM - deploy after your review.
Connects securely to your tools. The creator never sees your data.
About this skill
## Serverless that survives production (and the bill) The usual serverless problems: Lambdas calling Lambdas, `*` IAM policies, SQS without DLQs, one bad message blocking a batch, scans on DynamoDB, no alarms, surprise CloudWatch and NAT costs. AWS Serverless makes your agent build and review like a seasoned AWS architect. ## What it does - **Uses your IaC**: CDK, SAM, SST, Serverless Framework or Terraform - never adds a second one. - **Right pattern for each job**: HTTP API, API -> SQS for async work, EventBridge/SNS fan-out, Step Functions for workflows, Scheduler for cron, S3 -> SQS for files, Fargate for > 15 min tasks; service integrations instead of glue Lambdas; Mermaid diagram with sync/async and retry behaviour. - **DynamoDB from access patterns**: key and GSI design so every hot path is a Query, conditional writes, TTL, on-demand vs provisioned. - **Reliability**: idempotency, DLQs with alarms, visibility timeout >= 6x function timeout, partial batch responses, timeouts and retries with jitter, concurrency limits to protect downstreams. - **Security**: least-privilege IAM per function, Secrets Manager/SSM, auth at the edge, validation, private buckets, restricted CORS. - **Observability**: Powertools Logger, Metrics, Tracer; alarms on errors, throttles, DLQ depth, 5xx and p99; log retention. - **Cost & cold starts**: arm64, memory power tuning, batching, log costs, NAT vs VPC endpoints, bundle size, SnapStart or provisioned concurrency only where needed. - **Safe delivery**: synth/validate, tests, dev-stage deploys; never touches production or shared IAM without approval. ## Includes - SKILL.md workflow - references/patterns.md - pattern table, single-table DynamoDB example, SQS + Powertools batch handler, CDK queue/DLQ/alarm snippet - references/ops.md - review checklist, cost levers, cold-start tips, Powertools features Works with Claude Code, Codex, Cursor, Copilot, Gemini CLI and any SKILL.md-compatible agent.
No production deployments or resource deletions without approval. Requires user to provide existing IaC framework context to avoid tool mismatch.
How to use
- 1
Connect your agent to the Agensi MCP
Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup
- 2
Sign in to Agensi
Your agent shows a sign-in link. Sign in and click Allow.
- 3
Ask for what you need
Your agent loads this skill and uses it on your task. It always asks before any payment.
Reviews
This skill has been used 10 times.
Trust & safety
Security scan
Security scan passed 9 days ago
- Free with an Agensi account
Permissions
No special permissions declared or detected