All skills
aws avatar

/aws-serverless

@02b5aee

Builds, deploys, manages, debugs, configures, and optimizes serverless applications on AWS using Lambda, API Gateway, Step Functions, EventBridge, and SAM/CDK. Covers cold starts, CORS debugging, event source mappings, troubleshooting, concurrency, SnapStart, Powertools, function URLs, EventBridge Scheduler, Lambda layers, and production readiness. Triggers on mentions of Lambda, API Gateway, Step Functions, SAM templates, CDK serverless stacks, DynamoDB stream triggers, SQS event sources, cold starts, timeouts, 502/504 errors, throttling, concurrency, CORS, Powertools, or any event-driven architecture on AWS, even without the word "serverless." Does not apply to EC2, ECS/Fargate containers, or Amplify hosting.

Use this Skill: https://skilld.dev/gh/aws/agent-toolkit-for-aws/aws-serverless

This session only. Nothing lands on disk.

referencesdeployment.md

≈978 tokens on demand. Your agent reads this file only when SKILL.md points to it.

Deployment Reference

Serverless-specific resource types and fast-iteration tools. For step-by-step deployment procedures (custom domain REST API, API Gateway stages, connecting Lambda to API Gateway/DynamoDB), use the specialized skills in SKILL.md's routing table.

Contents


SAM resource types

SAM templates extend CloudFormation with Transform: AWS::Serverless-2016-10-31. Only Transform and Resources are required.

Resource Type Purpose
AWS::Serverless::Function Lambda + IAM role + event source mappings
AWS::Serverless::HttpApi HTTP API (API Gateway v2) — recommended
AWS::Serverless::Api REST API (v1) — WAF, usage plans, request validation
AWS::Serverless::SimpleTable DynamoDB with minimal config
AWS::Serverless::LayerVersion Lambda layer
AWS::Serverless::StateMachine Step Functions state machine
AWS::Serverless::Connector Simplified permissions between resources
AWS::Serverless::Application Nested serverless application (SAR or local)
AWS::Serverless::GraphQLApi AppSync GraphQL API
AWS::Serverless::WebSocketApi WebSocket API (API Gateway v2)
AWS::Serverless::CapacityProvider Lambda Managed Instances on customer-owned EC2

SAM Globals section

Eliminates duplication across functions/APIs. Supported types: Function, Api, HttpApi, SimpleTable, StateMachine, CapacityProvider.

Override rules:

Type Behavior
Primitives (string, number, boolean) Resource value replaces global
Maps (dictionaries) Merged — resource keys override matching global keys
Lists (arrays) Global entries prepended to resource entries

CDK serverless constructs

Prefer L2 constructs — they provide sensible defaults and least-privilege IAM via grant* methods.

Construct Module Use for
NodejsFunction aws-cdk-lib/aws-lambda-nodejs Node.js/TypeScript — bundles with esbuild automatically
PythonFunction @aws-cdk/aws-lambda-python-alpha Python — requires Docker for bundling
HttpApi aws-cdk-lib/aws-apigatewayv2 HTTP API with CORS, JWT auth
HttpLambdaIntegration aws-cdk-lib/aws-apigatewayv2-integrations Connect Lambda to HttpApi

Fast iteration

Both tools are development-only — they bypass CloudFormation safety and introduce drift. Use sam deploy or CI/CD for production.

SAM Accelerate

sam sync --watch --stack-name my-stack                            # Watch mode — auto-syncs on save
sam sync --code --watch --stack-name my-stack                     # Code-only (minimal sync time)
sam sync --code --resource-id MyFunction --watch --stack-name my-stack  # Single function

Code changes sync via service APIs in seconds. Infrastructure changes trigger CloudFormation (slower, automatic).

CDK hotswap / watch

cdk deploy --hotswap           # Direct resource update, skips non-hotswappable
cdk deploy --hotswap-fallback  # Hotswap with CloudFormation fallback
cdk watch                      # Watch mode (hotswap + file watching)

Hotswap supports: Lambda code/config/versions/aliases, Step Functions definitions, ECS images, S3 deployments, CodeBuild projects, AppSync resolvers/functions/schemas.

Comparison

Feature SAM Sync CDK Hotswap
Watch mode sam sync --watch cdk watch
Code-only sync sam sync --code cdk deploy --hotswap
Fallback to full deploy Automatic --hotswap-fallback
Selective resource sync --resource-id Not supported
Code change speed Seconds Seconds
Production safe No No

Source: SKILL.md on GitHub

No alerts6d3 checks · Risk SAFE
  • Gen Agent Trust Hub6d

    This skill provides architectural guidance and reference information for building and managing serverless applications on AWS, covering services such as Lambda, API Gateway, and Step Functions. It contains best practices, CLI commands for infrastructure management, and code templates. No security issues were identified.

  • Socket6d

    No alerts

  • Snyk6d

    Risk: LOW · No issues

Signed by skilld at 02b5aee. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub yesterday.

Activeupdated last week
metadata
{
  "version": "4"
}

README badge

README badge for aws/agent-toolkit-for-aws/aws-serverless