lambda-patterns

Implement AWS Lambda serverless patterns with Terraform and TypeScript.

Updated Feb 26, 2026
One-click install
npx skills add https://github.com/engineers-hub-ltd-in-house-project/eh-skills --skill lambda-patterns
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: lambda-patterns
Source: https://github.com/engineers-hub-ltd-in-house-project/eh-skills/tree/main/skills/aws-infrastructure/lambda-patterns
Command: npx skills add https://github.com/engineers-hub-ltd-in-house-project/eh-skills --skill lambda-patterns

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill provides best practices and reusable patterns for designing, deploying, and operating AWS Lambda functions in event-driven architectures, optimizing for performance, cost, and reliability.

Core Features & Use Cases

  • Function Design: Implement robust Lambda functions using Terraform and TypeScript, incorporating AWS Lambda Powertools for logging, tracing, and metrics.
  • Optimization: Optimize for cold starts, manage Lambda Layers for shared code, and configure Provisioned Concurrency for predictable performance.
  • Reliability: Implement Dead Letter Queues (DLQ) for failed messages and use SQS event source mapping with partial batch failure reporting.
  • Monitoring: Set up CloudWatch alarms for DLQ messages and Lambda errors.
  • Use Case: Deploy a scalable, event-driven API backend using API Gateway, Lambda, and DynamoDB, ensuring high availability and efficient error handling.

Quick Start

Deploy the provided Terraform configuration for an AWS Lambda function with SQS event source mapping and DLQ configured.

Frequently Asked Questions about lambda-patterns

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I optimize AWS Lambda cold starts using Provisioned Concurrency?

Reduce AWS Lambda cold starts by configuring Provisioned Concurrency via Terraform. This pre-initializes execution environments to eliminate initialization latency and deliver predictable performance for latency-sensitive, event-driven workloads.

How do I configure SQS event source mapping with a Dead Letter Queue in AWS Lambda?

Configure SQS event source mapping with a Dead Letter Queue (DLQ) using the provided Terraform scripts. This pattern captures failed messages and supports partial batch failure reporting to ensure reliable message processing.

What is the best way to manage AWS Lambda Layers for shared code in TypeScript?

The best way to manage AWS Lambda Layers for shared code is by extracting dependencies into a separate layer and deploying it alongside your TypeScript handler using Terraform to reduce deployment package size.

Does this AWS Lambda pattern support event-driven architectures with API Gateway and DynamoDB?

Yes, this AWS Lambda pattern supports event-driven architectures by deploying a scalable backend using API Gateway, Lambda, and DynamoDB. It integrates AWS Lambda Powertools for enhanced observability across the event-driven workflow.

How do I implement idempotency in an AWS Lambda function?

Implement idempotency in an AWS Lambda function by applying dedicated design patterns with AWS Lambda Powertools. This ensures safe retries without duplicate side effects, maintaining reliability in event-driven architectures.

How do I set up CloudWatch alarms for AWS Lambda errors and DLQ messages?

Set up CloudWatch alarms for AWS Lambda errors and DLQ messages by defining alarm thresholds in your Terraform configuration. This pattern ensures you receive alerts when function failures or dead-lettered messages occur.