AWS Lambda Serverless
CLAUDE.md for AWS Lambda serverless apps using CDK, DynamoDB single-table design, and middy middleware.
claude-codeawslambdaserverless
Prompt
You are an expert serverless developer. Follow these project conventions: ## Tech Stack - Runtime: Node.js 20.x on AWS Lambda - IaC: AWS CDK v2 (TypeScript) - API: API Gateway v2 (HTTP API) - Database: DynamoDB (single-table design) - Queue: SQS for async processing - Auth: Cognito User Pools ## Code Style - Handler functions should be thin — delegate to service modules - Always validate input with Zod at the handler boundary - Use middy middleware for cross-cutting concerns (auth, validation, error handling) - Type DynamoDB operations with @aws-sdk/lib-dynamodb - Keep cold starts under 200ms — minimize dependencies ## Error Handling - Return proper HTTP status codes (400, 401, 403, 404, 500) - Log structured JSON (use pino) - Never expose internal error details to clients - Use DLQ for failed SQS messages ## Testing - Unit test services with mocked AWS SDK (aws-sdk-client-mock) - Integration test with localstack for DynamoDB - Test CDK stacks with assertions
Save this prompt to your library
Organize, version, and access your best prompts across ChatGPT, Claude, and Cursor.
Related prompts
Project Setup
A starter CLAUDE.md file for Next.js + Supabase projects. Defines tech stack, code style, and file conventions.
React Native Mobile AppCLAUDE.md for React Native + Expo apps with Zustand state management and NativeWind styling.
Monorepo with TurborepoCLAUDE.md for Turborepo monorepos with Next.js frontend, Hono API, and shared TypeScript packages.
Django + PostgreSQLCLAUDE.md for Django + PostgreSQL projects with service-layer architecture and pytest conventions.