
Aws Lambda Typescript Integration
Stand up TypeScript AWS Lambda handlers with API Gateway or ALB, picking NestJS vs minimal TypeScript for bundle size and cold-start targets.
Overview
AWS Lambda TypeScript Integration is an agent skill most often used in Build (also Ship) that provides NestJS and raw TypeScript Lambda patterns with API Gateway or ALB integration and cold-start optimization.
Install
npx skills add https://github.com/giuseppe-trisciuoglio/developer-kit --skill aws-lambda-typescript-integrationWhat is this skill?
- Compares NestJS vs raw TypeScript with a decision table: cold start, bundle size, and complexity trade-offs
- Documents two stacks: NestJS (DI, modular, 100KB+ bundles) and raw TypeScript (<50KB, minimal overhead)
- Covers API Gateway and Application Load Balancer integration for the same handler patterns
- Targets cold-start optimization with a sub-500ms NestJS benchmark in the overview table
- Includes CI/CD setup guidance for deploying TypeScript Lambda functions
- Overview table cites NestJS cold start under 500ms with bundles 100KB+
- Raw TypeScript path targets bundles under 50KB
- Documents two integration fronts: API Gateway and ALB
Adoption & trust: 1k installs on skills.sh; 271 GitHub stars; 3/3 security scanners passed (skills.sh audits).
What problem does it solve?
You need a TypeScript Lambda on AWS but are unsure whether NestJS or minimal handlers fit your cold-start budget, bundle size, and API ingress.
Who is it for?
Solo or indie builders shipping TypeScript serverless APIs on AWS who must choose NestJS vs lean handlers and wire API Gateway or ALB.
Skip if: Teams standardized on non-AWS runtimes, Python-only Lambda shops, or builders who only need generic Terraform without handler-level TypeScript patterns.
When should I use this skill?
Creating or deploying TypeScript Lambda functions, choosing NestJS vs raw TypeScript, optimizing cold starts, configuring API Gateway or ALB, or implementing serverless TypeScript applications—including triggers like cre
What do I get? / Deliverables
You leave with a chosen NestJS or raw TypeScript approach, integration pattern for API Gateway or ALB, and deployment-oriented steps aligned to your performance target.
- Chosen NestJS or raw TypeScript Lambda structure with matching bundle expectations
- API Gateway or ALB integration pattern applied to the handler
- Deployment-oriented steps including CI/CD guidance for the TypeScript function
Recommended Skills
Journey fit
Spans multiple journey phases - primary shelf plus alternate fits below.
Lambda authoring and AWS wiring are core product build work before you ship serverless APIs to production. The skill focuses on integration patterns—API Gateway, ALB, and handler structure—not generic frontend or PM workflows.
Where it fits
Scaffold a new TypeScript handler and decide API Gateway vs ALB before coding the route map.
Pick NestJS for a modular API that needs DI versus raw TypeScript for a single-purpose webhook.
Tune bundle size and initialization so NestJS cold starts stay under the documented sub-500ms target.
Wire CI/CD steps to deploy the chosen TypeScript Lambda artifact after integration tests pass.
How it compares
Use for opinionated TypeScript Lambda handler and ingress patterns—not as a full multi-cloud IaC catalog or a local-only dev server skill.
Common Questions / FAQ
Who is aws-lambda-typescript-integration for?
It is for solo and indie builders implementing or deploying TypeScript functions on AWS Lambda who care about integration shape and cold-start behavior.
When should I use aws-lambda-typescript-integration?
Use it during Build when creating handlers and AWS integrations, and during Ship when optimizing cold starts, choosing NestJS vs raw TypeScript, or setting up CI/CD for Lambda deploys.
Is aws-lambda-typescript-integration safe to install?
Review the Security Audits panel on this Prism page for published audit results; the skill allows Read, Write, Edit, Glob, Grep, and Bash, so treat deploy commands and credentials like any production AWS workflow.
SKILL.md
READMESKILL.md - Aws Lambda Typescript Integration
# AWS Lambda TypeScript Integration Patterns for creating high-performance AWS Lambda functions in TypeScript with optimized cold starts. ## Overview Two approaches for TypeScript Lambda: 1. **NestJS Framework** - Dependency injection, modular architecture, larger bundle (100KB+) 2. **Raw TypeScript** - Minimal overhead, smaller bundle (<50KB), maximum control Both support API Gateway and ALB integration. ## When to Use - Creating new Lambda functions in TypeScript - Optimizing cold start performance - Choosing between NestJS and minimal TypeScript - Configuring API Gateway or ALB integration - Setting up CI/CD for TypeScript Lambda ## Instructions ### 1. Choose Your Approach | Approach | Cold Start | Bundle Size | Best For | Complexity | |----------|------------|-------------|----------|------------| | NestJS | < 500ms | Larger (100KB+) | Complex APIs, enterprise apps, DI needed | Medium | | Raw TypeScript | < 100ms | Smaller (< 50KB) | Simple handlers, microservices, minimal deps | Low | ### 2. Project Structure #### NestJS Structure ``` my-nestjs-lambda/ ├── src/ │ ├── app.module.ts │ ├── main.ts │ ├── lambda.ts # Lambda entry point │ └── modules/ │ └── api/ ├── package.json ├── tsconfig.json └── serverless.yml ``` #### Raw TypeScript Structure ``` my-ts-lambda/ ├── src/ │ ├── handlers/ │ │ └── api.handler.ts │ ├── services/ │ └── utils/ ├── dist/ # Compiled output ├── package.json ├── tsconfig.json └── template.yaml ``` ### 3. Implementation Examples See the [References](#references) section for detailed implementation guides. Quick examples: **NestJS Handler:** ```typescript // lambda.ts import { NestFactory } from '@nestjs/core'; import { ExpressAdapter } from '@nestjs/platform-express'; import serverlessExpress from '@codegenie/serverless-express'; import { Context, Handler } from 'aws-lambda'; import express from 'express'; import { AppModule } from './src/app.module'; let cachedServer: Handler; async function bootstrap(): Promise<Handler> { const expressApp = express(); const adapter = new ExpressAdapter(expressApp); const nestApp = await NestFactory.create(AppModule, adapter); await nestApp.init(); return serverlessExpress({ app: expressApp }); } export const handler: Handler = async (event: any, context: Context) => { if (!cachedServer) { cachedServer = await bootstrap(); } return cachedServer(event, context); }; ``` **Raw TypeScript Handler:** ```typescript // src/handlers/api.handler.ts import { APIGatewayProxyEvent, APIGatewayProxyResult, Context } from 'aws-lambda'; export const handler = async ( event: APIGatewayProxyEvent, context: Context ): Promise<APIGatewayProxyResult> => { return { statusCode: 200, headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ message: 'Hello from TypeScript Lambda!' }) }; }; ``` ## Core Concepts ### Cold Start Optimization TypeScript cold start depends on bundle size and initialization code. Key strategies: 1. **Lazy Loading** - Defer heavy imports until needed 2. **Tree Shaking** - Remove unused code from bundle 3. **Minification** - Use esbuild or terser for smaller bundles 4. **Instance Caching** - Cache initialized services between invocations See [Raw TypeScript Lambda](references/raw-typescript-lambda.md#cold-start-optimization) for detailed patterns.