aws-serverless
Skill9 starsChanged 8 months agoMITView on GitHub
Building production-ready serverless applications on AWS. Use when working with Lambda, API Gateway, SQS, SNS, DynamoDB Streams, SAM/CDK deployment or optimizing cold starts.
- Reads credentials
7 other projects use a version of this, 3 of them edited.
Adopted by
Most recently taken up by
- delorenj/skillstheir own version, first seen Oct 2, 2026
- nimadorostkar/Claude-Skills-collectiontheir own version, first seen Jul 14, 2026
- aws/agent-toolkit-for-awstheir own version, first seen Jun 17, 2026
- tranhieutt/software_development_departmentedited, first seen Apr 30, 2026
- ai4brands-design/claude-skillsedited, first seen Mar 22, 2026
- a-pavithraa/aws-serverless-skilltheir own version, first seen Feb 25, 2026
Other versions7 projects use a version of this.
Word for word · 0
None found.
Edited · 3
- tranhieutt/software_development_department★ 7220% same
- xfstudio/skills★ 925% same
- ai4brands-design/claude-skills★ 225% same
Wrote their own version · 4
- aws/agent-toolkit-for-aws★ 2.8ksame name
- nimadorostkar/Claude-Skills-collection★ 28same name
- delorenj/skills★ 15same name
- a-pavithraa/aws-serverless-skill★ 8same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository21 other files it gives its agents.
- aws-apiSkill
- aws-architectureSkill
- aws-cdkSkill
- aws-cloudfrontSkill
- aws-cost-operationsSkill
- aws-diagramsSkill
- aws-dynamodbSkill
- aws-ec2Skill
- aws-lambda-pythonSkill
- aws-lambda-typescriptSkill
- aws-observabilitySkill
- aws-rdsSkill
- aws-s3Skill
- aws-securitySkill
- aws-terraformSkill
- aws-testingSkill
- find-skillsSkill
- javascript-runtimeSkill
- orbit-bootstrapSkill
- python-runtimeSkill
- typescript-runtimeSkill
The file
We split this skill into the rules it gives an agent
1 rule. About 0 are common, 1 is distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 369
No hardcodear secretos. Usar SSM Parameter Store o Secrets Manager.
≈ “Common” is an estimate: at least 1 in 5 of the 213,895 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
AWS Serverless
Skill para construir aplicaciones serverless production-ready en AWS. Cubre Lambda functions, API Gateway (REST/HTTP/WebSocket), arquitecturas event-driven con SQS/SNS/DynamoDB Streams, modelado DynamoDB, despliegue con SAM/CDK, y optimización de cold starts.
Principios fundamentales
- Serverless-first: diseñar para ejecución efímera, stateless y event-driven.
- Cada Lambda = una responsabilidad. No monolitos Lambda.
- Inicializar clientes AWS fuera del handler (reutilización en warm starts).
- Usar partial batch failure reporting en SQS/Kinesis/DynamoDB Streams.
- Dead Letter Queues (DLQ) obligatorias en toda cola y suscripción.
- Idempotencia en todo handler que procese eventos (at-least-once delivery).
- Observabilidad desde el día 1: structured logging, tracing, métricas custom.
Patrones de Lambda Handler
Node.js Handler (TypeScript)
import { Logger } from '@aws-lambda-powertools/logger';
import { Tracer } from '@aws-lambda-powertools/tracer';
import { DynamoDBClient } from '@aws-sdk/client-dynamodb';
import { DynamoDBDocumentClient, GetCommand } from '@aws-sdk/lib-dynamodb';
import type { APIGatewayProxyEventV2, APIGatewayProxyResultV2 } from 'aws-lambda';
const logger = new Logger({ serviceName: 'mi-servicio' });
const tracer = new Tracer({ serviceName: 'mi-servicio' });
// Inicializar fuera del handler (warm start reuse)
const client = tracer.captureAWSv3Client(new DynamoDBClient({}));
const docClient = DynamoDBDocumentClient.from(client);
const TABLE_NAME = process.env.TABLE_NAME!;
export const handler = async (
event: APIGatewayProxyEventV2
): Promise<APIGatewayProxyResultV2> => {
try {
const body = typeof event.body === 'string' ? JSON.parse(event.body) : event.body;
const result = await processRequest(body);
return {
statusCode: 200,
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify(result),
};
} catch (error) {
logger.error('Error processing request', { error });
return {
statusCode: 500,
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ error: 'Internal server error' }),
};
}
};Python Handler
import json
import os
import logging
import boto3
from aws_lambda_powertools import Logger, Tracer, Metrics
from aws_lambda_powertools.utilities.typing import LambdaContext
logger = Logger(service="mi-servicio")
tracer = Tracer(service="mi-servicio")
metrics = Metrics(namespace="MiApp", service="mi-servicio")
# Inicializar fuera del handler
dynamodb = boto3.resource('dynamodb')
table = dynamodb.Table(os.environ['TABLE_NAME'])
@logger.inject_lambda_context
@tracer.capture_lambda_handler
@metrics.log_metrics(capture_cold_start_metric=True)
def handler(event: dict, context: LambdaContext) -> dict:
try:
body = json.loads(event.get('body', '{}'))
result = process_request(body)
return {
'statusCode': 200,
'headers': {'Content-Type': 'application/json'},
'body': json.dumps(result)
}
except Exception as e:
logger.exception("Error processing request")
return {
'statusCode': 500,
'body': json.dumps({'error': 'Internal server error'})
}API Gateway Integration
HTTP API (recomendado para casos simples)
# template.yaml (SAM)
AWSTemplateFormatVersion: '2010-09-09'
Transform: AWS::Serverless-2016-10-31
Globals:
Function:
Runtime: nodejs20.x
Timeout: 30
MemorySize: 256
Environment:
Variables:
TABLE_NAME: !Ref ItemsTable
POWERTOOLS_SERVICE_NAME: mi-servicio
Resources:
HttpApi:
Type: AWS::Serverless::HttpApi
Properties:
StageName: prod
CorsConfiguration:
AllowOrigins: ["*"]
AllowMethods: [GET, POST, PUT, DELETE]
AllowHeaders: ["*"]
GetItemFunction:
Type: AWS::Serverless::Function
Properties:
Handler: src/handlers/get.handler
Events:
GetItem:
Type: HttpApi
Properties:
ApiId: !Ref HttpApi
Path: /items/{id}
Method: GET
Policies:
- DynamoDBReadPolicy:
TableName: !Ref ItemsTable
CreateItemFunction:
Type: AWS::Serverless::Function
Properties:
Handler: src/handlers/create.handler
Events:
CreateItem:
Type: HttpApi
Properties:
ApiId: !Ref HttpApi
Path: /items
Method: POST
Policies:
- DynamoDBCrudPolicy:
TableName: !Ref ItemsTable
ItemsTable:
Type: AWS::DynamoDB::Table
Properties:
AttributeDefinitions:
- AttributeName: id
AttributeType: S
KeySchema:
- AttributeName: id
KeyType: HASH
BillingMode: PAY_PER_REQUESTREST API (cuando se necesita validación, throttling, API keys)
RestApi:
Type: AWS::Serverless::Api
Properties:
StageName: prod
Auth:
DefaultAuthorizer: CognitoAuthorizer
Authorizers:
CognitoAuthorizer:
UserPoolArn: !GetAtt UserPool.Arn
Models:
CreateItemModel:
type: object
required: [name, price]
properties:
name: { type: string, minLength: 1 }
price: { type: number, minimum: 0 }Patrones Event-Driven
SQS con Partial Batch Failure
Resources:
ProcessorFunction:
Type: AWS::Serverless::Function
Properties:
Handler: src/handlers/processor.handler
Events:
SQSEvent:
Type: SQS
Properties:
Queue: !GetAtt ProcessingQueue.Arn
BatchSize: 10
FunctionResponseTypes:
- ReportBatchItemFailures
ProcessingQueue:
Type: AWS::SQS::Queue
Properties:
VisibilityTimeout: 180 # 6x Lambda timeout
RedrivePolicy:
deadLetterTargetArn: !GetAtt DeadLetterQueue.Arn
maxReceiveCount: 3
DeadLetterQueue:
Type: AWS::SQS::Queue
Properties:
MessageRetentionPeriod: 1209600 # 14 días// Handler con partial batch failure reporting
import type { SQSEvent, SQSBatchResponse } from 'aws-lambda';
export const handler = async (event: SQSEvent): Promise<SQSBatchResponse> => {
const batchItemFailures: SQSBatchResponse['batchItemFailures'] = [];
for (const record of event.Records) {
try {
const body = JSON.parse(record.body);
await processMessage(body);
} catch (error) {
console.error(`Failed message ${record.messageId}:`, error);
batchItemFailures.push({ itemIdentifier: record.messageId });
}
}
return { batchItemFailures };
};SNS Fan-Out
OrderTopic:
Type: AWS::SNS::Topic
EmailNotificationFunction:
Type: AWS::Serverless::Function
Properties:
Handler: src/handlers/email.handler
Events:
SNSEvent:
Type: SNS
Properties:
Topic: !Ref OrderTopic
FilterPolicy:
type: [order_confirmed]
InventoryUpdateFunction:
Type: AWS::Serverless::Function
Properties:
Handler: src/handlers/inventory.handler
Events:
SNSEvent:
Type: SNS
Properties:
Topic: !Ref OrderTopicDynamoDB Streams
StreamProcessorFunction:
Type: AWS::Serverless::Function
Properties:
Handler: src/handlers/stream.handler
Events:
DDBStream:
Type: DynamoDB
Properties:
Stream: !GetAtt OrdersTable.StreamArn
StartingPosition: TRIM_HORIZON
BatchSize: 100
MaximumBatchingWindowInSeconds: 5
FunctionResponseTypes:
- ReportBatchItemFailures
FilterCriteria:
Filters:
- Pattern: '{"eventName": ["INSERT", "MODIFY"]}'Step Functions (orquestación)
OrderStateMachine:
Type: AWS::Serverless::StateMachine
Properties:
DefinitionUri: statemachine/order.asl.json
Policies:
- LambdaInvokePolicy:
FunctionName: !Ref ValidateOrderFunction
- LambdaInvokePolicy:
FunctionName: !Ref ProcessPaymentFunction
- DynamoDBCrudPolicy:
TableName: !Ref OrdersTableOptimización de Cold Starts
Estrategias generales
| Estrategia | Impacto | Complejidad |
| Minimizar bundle size | Alto | Bajo |
| Lazy loading de dependencias | Medio | Bajo |
| Inicializar clientes fuera del handler | Alto | Bajo |
| Aumentar memoria (más CPU) | Medio | Bajo |
| Provisioned Concurrency | Alto | Medio |
| SnapStart (Java) | Alto | Bajo |
| Evitar VPC si no es necesario | Alto | Bajo |
Node.js específico
// ✅ Lazy loading para dependencias pesadas
let heavyLib: typeof import('heavy-lib') | undefined;
const getHeavyLib = async () => {
if (!heavyLib) {
heavyLib = await import('heavy-lib');
}
return heavyLib;
};
// ✅ Tree shaking: importar solo lo necesario
import { DynamoDBClient } from '@aws-sdk/client-dynamodb'; // ✅
// import AWS from 'aws-sdk'; // ❌ SDK v2 completoPython específico
# ✅ Lazy loading
_s3_client = None
def get_s3_client():
global _s3_client
if _s3_client is None:
_s3_client = boto3.client('s3')
return _s3_clientConfiguración de memoria
# Usar AWS Lambda Power Tuning para encontrar el sweet spot
# https://github.com/alexcasalboni/aws-lambda-power-tuning
sam deploy --template-file power-tuning.yamlSeguridad Serverless
- IAM: least privilege por función. Usar SAM policy templates.
- No hardcodear secretos. Usar SSM Parameter Store o Secrets Manager.
- Validar todo input del evento.
- CORS restrictivo en producción (no
*). - API keys + usage plans para rate limiting en REST API.
- Cognito o Lambda authorizers para autenticación.
Anti-patrones
- ❌ Lambda monolítico con múltiples responsabilidades.
- ❌ Dependencias pesadas que inflan el bundle (SDK v2 completo, ORM pesados).
- ❌ Crear clientes AWS dentro del handler (nuevo cliente por invocación).
- ❌ No usar DLQ en colas SQS ni suscripciones SNS.
- ❌ Ignorar partial batch failure reporting (reprocesar todo el batch).
- ❌ Timeout de Lambda > VisibilityTimeout de SQS (mensajes duplicados).
- ❌ Llamadas síncronas en cadena entre Lambdas (usar Step Functions).
- ❌ VPC sin necesidad real (agrega latencia al cold start).
- ❌
console.logsin estructura (imposible de filtrar en CloudWatch Insights). - ❌ No tener idempotencia en handlers event-driven.
Checklist de revisión Serverless
- Cada Lambda tiene una sola responsabilidad.
- Clientes AWS inicializados fuera del handler.
- Partial batch failure reporting habilitado en SQS/Kinesis/Streams.
- DLQ configurada en todas las colas y suscripciones.
- Idempotencia implementada donde aplica.
- Structured logging con Powertools.
- Tracing activo (X-Ray o Powertools Tracer).
- IAM least privilege por función.
- Input validado en cada handler.
- Cold start medido y optimizado.
- Timeout y memoria configurados según carga real.
- Tests unitarios y de integración.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

