AI Agent Hub
Back to skills
💻

AWS Serverless Development Patterns

Development Updated 2026.08.30

Paste the following prompt into your AI chat to install this skill:

Please install @org-02qudk26/aws-serverless according to https://skillhub.cn/install/skillhub.md.

About this skill

Problem Being Solved

In AWS Serverless, many production issues are not caused by missing frameworks, but by missing reusable function structure: Lambda needs consistent event parsing, error handling, and API Gateway-compatible responses; asynchronous jobs need reliable message consumption, retry of failed items, and visibility timeout control. This skill breaks those concerns into practical patterns that help engineers write more production-like function code in Node.js and Python.

Core Capabilities and Steps

  • Lambda Handler Pattern: Initialize clients outside the handler to reduce per-invocation overhead; use try/catch or try/except to capture errors, log requestId and stack traces, and return responses with statusCode, headers, and body.
  • Event-Driven SQS Pattern: Bind an SQS queue in a SAM template, configure VisibilityTimeout, maxReceiveCount, and a dead-letter queue; iterate through Records in the handler and write failed items into batchItemFailures for partial batch failure handling.
  • Anti-Patterns and Sharp Edges: Warn against monolithic Lambda, large dependencies, and synchronous calls inside a VPC, and highlight runtime details such as cold starts, timeouts, memory, and event-loop waiting.

Scope and Caveats

The material focuses on common development patterns for AWS Lambda, API Gateway, DynamoDB, and SQS, so it is not a substitute for architecture decisions. Before use, confirm queue timeouts, permissions, environment variables, and target service versions; in production, add logging, metrics, least-privilege IAM, and cost monitoring.

Use Cases

  • Use when building Node.js Lambda handlers for API Gateway with consistent error responses
  • Use when wiring SQS-triggered Lambda to consume messages with batch failures and DLQ
  • Use when debugging Lambda cold starts, timeouts, VPC connections, and memory settings
  • Use when implementing Python Lambda queries against DynamoDB with requestId logging

Best For

  • Engineers maintaining Lambda API backends who need consistent error codes and response shapes
  • Engineers building async pipelines who need SQS batch processing and DLQ retry rules
  • Engineers optimizing performance who need to debug Lambda cold starts and VPC timeouts
  • Engineers migrating Python or Node.js functions who need reusable production-grade handler patterns