gs-bun-aws-lambda
Installation
SKILL.md
Bun AWS Lambda (Clean Architecture)
Handler Pattern - Thin Adapter
Lambda handlers are thin adapters that:
- Initialize DI Container (cold start)
- Parse input
- Resolve Use Case from DI
- Execute and return result
- Map domain exceptions to HTTP status
// src/functions/create-category.ts
import type { APIGatewayProxyEventV2, APIGatewayProxyResultV2 } from 'aws-lambda'
import { DIContainer, TOKENS, initializeDI } from '@/backend/di'
import type { CreateCategoryUseCase } from '@/backend/application/category/use-cases'
import { DomainException, NotFoundException } from '@/backend/domain/shared/exceptions'
let initialized = false