Core Skills
Skill 56 of 156
Routes serverless requests to a compute form factor and the skill that owns it.
24 minutes · 5,257 words · 16 sections
Install
npx skills add aws/agent-toolkit-for-aws --skill aws-serverlessnpx skills add aws/agent-toolkit-for-aws/plugin marketplace add aws/agent-toolkit-for-awsThe first command installs just this skill, by the name in its SKILL.md; the second installs the whole repository.
This skill is the router for serverless work on AWS. It makes one opinionated recommendation for each application component and each raised decision dimension (form factor + capacity provider + orchestration + feature choices), then hands off to every specialized skill needed for that composition. Do not force a multi-component application onto one form factor. This skill keeps only the shared Lambda reference material that has no dedicated skill.
Works best with the AWS MCP server (opens in a new tab) — recommended for sandboxed command execution and audit logging. All guidance also works with standard AWS CLI access.
How to use this skill: Step 0 fixes the entry point (new, optimizing, migrating); Step 1 routes components that already name the technology; Step 2 walks the compute decision flow (Tier 1 → 2) for each component until its form factor and capacity provider are locked, with the Tier 3 edge cases detailed in compute-decision-edge-cases.md (opens in a new tab); Steps 3–5 resolve orchestration, eventing and the HTTP front door only when the request raises them, with the full comparisons in orchestration.md (opens in a new tab) and api-gateway.md (opens in a new tab). Then hand off to every applicable specialized skill and fall back to the shared references for anything without a dedicated skill.
If a routed skill is not available in your environment, the decision made here still stands.
Be opinionated per component and resolved dimension. State “Use X because …”. Do not force one service across components with different requirements, and do not present neutral comparison tables as the answer. For a Decided dimension, add one clause naming why the closest alternative does not fit (for example, Event and Web Functions have no OS-level access for eBPF; Durable Functions has no native .sync integration to start and wait on Glue or ECS jobs), and keep the recommendation and its reasons in the final response even after consulting other skills or documentation.
Resolve every raised component and decision dimension independently. Form factor, capacity provider, orchestration and feature constraints are separate decisions; resolving one does not close another. Different components may use different form factors, and one component may pair a compute form factor with an orchestration layer.
Infer facts, not boundaries: classify each raised dimension before answering.
Do not reopen an unraised or decided dimension, ask no more than 3–4 questions overall, and never reply with questions alone. When a numeric threshold decides the route, name it in the question so the customer can answer from their metrics (for example, a peak-to-mean ratio below 2 within 5–10 minutes for Managed Instances, Tier 2).
Revise. New information → re-run the affected tier and update the recommendation.
Do not guess facts. Ground limits, runtimes, pricing and timeouts in the shared references below and confirm against current AWS documentation when precision matters.
Route, do not duplicate. Once a specialized skill is chosen, follow it rather than re-deriving its content here.
If unclear, ask once: “Are you starting something new, tuning a workload you already have, or moving an existing workload onto serverless?”
| Context | Signals | Path |
|---|---|---|
| New application | “building”, “starting”, “new project”, “greenfield”, no existing compute named | Step 1, then the Step 2 decision flow |
| Optimizing existing | “bill is too high”, “cold starts”, “too slow”, “lag”, names a current Lambda setup | Step 2 Tier 2–3 (capacity, cold start, throughput), then lambda.md (opens in a new tab), concurrency.md (opens in a new tab), troubleshooting.md (opens in a new tab) |
| Re-platform / migrate | “moving off EC2/ECS”, “containerize”, “get off servers”, “modernizing” | Step 2 with runtime, duration and packaging as the first constraints, then optimize |
| Route to | When the request names or clearly implies | Do not route when |
|---|---|---|
| Event Functions — this skill: lambda.md (opens in a new tab), event-sources.md (opens in a new tab) | A Lambda function invoked by an event source or trigger (SQS, Kinesis, Kafka, S3, DynamoDB Streams, EventBridge, SNS, API Gateway, ALB, IoT, Function URL), an HTTP handler, API or webhook receiver in a stated non-Node.js runtime, a container image, Lambda layers | A Node.js HTTP server listening on a port (Web Functions), an HTTP endpoint, API or webhook receiver with no stated runtime (Step 5), a customer-managed environment (MicroVMs), or a compute choice that is still open — Step 2. Tier 2 still decides the capacity provider |
| aws-lambda-web-functions | Lambda Web Functions, aws lambda-web, deploying a Node.js HTTP server (Express, Hono, Fastify) on Lambda, CloudFront-fronted Node.js apps, multi-region HTTP endpoints, active-CPU billing or native HTTP response streaming for a Node.js HTTP server | Stated non-Node.js runtimes, container images, event-driven triggers (SQS, Kinesis, S3, DynamoDB Streams) — these are Event Functions |
| aws-lambda-microvms | Lambda MicroVMs, Firecracker microVM images, launch/suspend/resume/terminate, snapshot-resumable environments, VM-level isolation, untrusted/AI-generated code execution, retained files/processes across interactions, OS access (FUSE, eBPF), gRPC or WebSocket servers on custom ports, sessions up to 8 hours | “isolation” alone for ordinary request/response or event handlers. Event Functions have per-function isolation by default; use tenant isolation mode when environments must be dedicated to one invoker |
| aws-lambda-managed-instances | Lambda Managed Instances (LMI), capacity providers, CapacityProviderConfig, PerExecutionEnvironmentMaxConcurrency, EC2-backed Lambda, Savings Plans / Reserved Instances for Lambda, specific instance types for functions, async or ESM executions up to 90 minutes | Bursty traffic that scales to zero with no instance-type or commitment requirement |
| aws-lambda-durable-functions | Durable execution, checkpoint-and-replay, context.step / context.wait / context.invoke, withDurableExecution, durable-execution-sdk, saga written as code on Lambda, LocalDurableTestRunner | A visual/ASL workflow, Distributed Map, or broad orchestration of AWS services and non-Lambda compute — see Step 3 |
| aws-step-functions | State machines, Amazon States Language (ASL), JSONata, Distributed Map, .sync / waitForTaskToken, orchestrating ECS/Fargate, Glue, SageMaker, Batch | Code-first orchestration owned in Lambda application code — see Step 3 |
| amazon-eventbridge-event-bus | The new EventBridge custom event bus (eventsv2), any new workload publishing its own application events (including single-account), pub/sub, independent subscribers, choreography, a central bus shared across teams/accounts, ordered delivery per event group, replay, retention, deduplication, schema registry with open formats (CloudEvents, Avro, Protobuf), or migration from a classic custom bus to those capabilities | Operating an existing classic custom bus with rules and targets, EventBridge Scheduler, Pipes, Global Endpoints, the Schema Registry on its own, API Destinations or Connections — these stay with this skill (Step 4 and orchestration.md (opens in a new tab)) |
Run the tiers independently for each application component. Drop to the next tier only when the previous one did not produce a confident match for that component. Lock its form factor first (Tier 1); Tier 2 decides the Event Functions capacity provider and Step 3 decides orchestration. If the prompt is too vague to identify any component, ask: “What are you trying to build?”
Lambda has three form factors: Event Functions, Web Functions and MicroVMs. Scan these signals against the request; the capacity provider (On-Demand vs Managed Instances) is a separate decision in Tier 2.
| Form factor | Locks when the request has | Typical use cases |
|---|---|---|
| Event Functions | An event source or trigger (SQS, Kinesis, Kafka, S3, DynamoDB Streams, EventBridge, SNS, API Gateway, ALB, IoT, Function URL), a stated non-Node.js runtime for an HTTP handler, a container image, Lambda layers, event fan-out, retries/DLQ/idempotency semantics | Event-driven processing, queue/stream consumers, glue between services, API Gateway backends |
| Web Functions | A Node.js HTTP server that listens on a port (Express, Hono, Fastify). For such a server, these also point here: I/O-heavy request/response where most time is waiting on network, native response streaming or SSE, long-held/long-polling connections, multi-concurrent requests in one sandbox, CloudFront in front, multi-Region endpoints, “pay only for active CPU” | Web apps and REST backends in Node.js, streaming AI responses, Node.js backends that fan out parallel calls to downstream services and assemble the response |
| MicroVMs | Customer-managed sandbox lifecycle (launch/suspend/resume/terminate), state that must persist across a session (memory, disk, processes), untrusted or LLM-generated code, OS access (FUSE, eBPF), custom ports, per-session or per-tenant VM isolation, sessions up to 8 hours | AI-agent code sandboxes, browser IDEs and notebooks, CI/build runners, security scanners, ephemeral dev environments |
Check the runtime and trigger before the billing words. A stated non-Node.js runtime is Event Functions, and an event-driven function or a queue/stream trigger locks Event Functions, whatever the request says about paying for idle wait, I/O-bound work or multi-concurrency. When the runtime or trigger decides the form factor, state it in the answer as the reason Web Functions does not apply. For an Event Function those wants are Managed Instances signals in Tier 2, because Managed Instances runs several invocations at once in one execution environment. An HTTP endpoint, API or webhook receiver whose runtime is not stated is neither: do not assume a runtime; use the Step 5 lean-and-ask rule.
More than one row may match when the request describes several components. Route each component separately—for example, a Web Function control-plane API plus MicroVM session workers—rather than treating the rows as mutually exclusive for the whole application.
Constraints that decide ties: Web Functions and MicroVMs run on On-Demand only; Managed Instances is an Event Functions capacity provider (Tier 2), not a form factor; Durable Functions runs on Event Functions (On-Demand or Managed Instances) only. Web Functions is Node.js only (zip, no container images, no event source mappings, no Provisioned Concurrency or SnapStart). Duration ceilings: 15 min per invocation on On-Demand, on Web Functions and for synchronous invocations on Managed Instances; 90 min on Managed Instances for async or ESM invocations; 8 h per MicroVM session; longer than that is outside Lambda.
Narrowing questions (only when Tier 1 cannot classify a component from the request; skip facts already supplied):
Web Functions → route to aws-lambda-web-functions (On-Demand only; Provisioned Concurrency, SnapStart and Managed Instances do not apply). Essentials if that skill is not loaded: the Node.js server keeps listening on its port with no handler rewrite; zip deployment via aws lambda-web create-web-function (an unrecognized lambda-web command means the AWS CLI is outdated); many concurrent requests share one execution environment and billing is active CPU + memory, so time blocked on I/O is not billed as CPU; native response streaming (SSE, LLM tokens); a global HTTPS endpoint with optional multi-Region serving, CloudFront in front. Lambda Web Adapter is not a substitute for Web Functions on a Node.js HTTP app — it is the Event Functions path for non-Node.js runtimes, container images, or an existing API Gateway integration.
Durability is not a form-factor question: whether the work runs as multiple coordinated steps that must survive a crash, or waits on timers, callbacks or approvals and then resumes, is decided in Step 3 once the form factor and capacity provider are known (Durable Functions runs on Event Functions with either supported capacity provider: On-Demand or Managed Instances).
Event Functions run on one of two capacity providers. On-Demand scales to zero and suits spiky or unpredictable traffic with meaningful idle periods. Lambda Managed Instances runs the function on EC2 instances in your account and fits continuously utilized traffic (peak-to-mean ratio below 2 within 5–10 minutes); a required EC2 instance type; Savings Plans / Reserved Instance pricing; or executions up to 90 minutes (async or ESM invocations only). Typical Managed Instances workloads: continuously busy stream consumers, always-busy APIs behind API Gateway, and long async batch jobs.
Infer traffic shape from the request or metrics. If it is missing and changes the decision, ask once in observable terms: “Does peak traffic stay below twice the average within any 5–10 minute window (peak-to-mean ratio below 2), or does it spike higher or drain and sit idle for meaningful periods? Do you require committed-use pricing or a specific instance type?”
Managed Instances is chosen when the function is created: create a new function attached to a capacity provider and shift traffic to it; do not describe this as toggling a setting on an existing On-Demand function.
Also choose Managed Instances when a single execution needs more than 15 minutes, up to 90 minutes (async or ESM invocation only; synchronous invocations keep the 15-minute ceiling on both providers). Do not reopen an explicit continuous/always-busy signal merely to ask about instance type or pricing. If the request says only “steady” without observable traffic shape, ask whether it truly runs continuously or has long idle periods. Wanting processing to stay “steady” or “predictable” is a throughput-control goal (Tier 3, stream or queue consumers), not a traffic-shape signal. Words such as “bursty”, “light”, “uneven” or “quiet for long stretches” lean On-Demand but are Leaning hints (Rule 3) when Managed Instances is being weighed: recommend On-Demand provisionally and ask how many invocations run at the same time at peak (Managed Instances packs several simultaneous invocations into one execution environment, so it pays off only when they run concurrently) and whether traffic really drops to zero. A “high-volume” stream or queue is also Leaning, toward Managed Instances: volume alone does not give the traffic shape, so recommend Managed Instances provisionally and ask the peak-to-mean question above; it is Decided only when the request says the consumer is always busy or runs continuously. Per-key ordering bounds parallelism on either provider: Kinesis and DynamoDB Streams keep order per partition key, so concurrency is at most shards × ParallelizationFactor (1–10), and an SQS FIFO queue runs at most one batch per message group ID at a time (event-sources.md (opens in a new tab)). Many short parallel tasks are not by themselves a Managed Instances signal; ask whether the work is a one-off or periodic batch that drains to zero (On-Demand) or a continuous stream (Managed Instances).
Headline decisions; the questions to ask, thresholds and caveats are in compute-decision-edge-cases.md (opens in a new tab) — read it whenever a request raises one of these.
ApproximateAgeOfOldestRecord climbing) → provisioned mode for the event source mapping (min/max pollers); Provisioned Concurrency does nothing for a backlog — concurrency.md (opens in a new tab).ScalingConfig.MaximumConcurrency, 2–1,000), which caps how many invocations that queue drives while messages wait in the queue, then ask: “Is the goal to cap throughput so the database is never overloaded, or to guarantee a minimum processing rate during spikes?” A cap → maximum concurrency; a guaranteed floor → provisioned mode for the event source mapping (minimum pollers). The two cannot be combined on the same mapping. Reserved concurrency caps the whole function instead — concurrency.md (opens in a new tab).Apply every relevant row. A specialized skill owns each implementation dimension; a component can require both a compute skill and an orchestration skill. For Event Functions · On-Demand, open only the reference whose trigger applies.
| Decision or feature | Continue with |
|---|---|
| Event Functions · Managed Instances | aws-lambda-managed-instances |
| Web Functions | aws-lambda-web-functions |
| MicroVMs | aws-lambda-microvms |
| Durable Functions | aws-lambda-durable-functions |
| Event Functions · On-Demand — function configuration: memory, timeout, VPC, layers, Function URLs, cold starts, SnapStart, packaging (zip vs container image) | lambda.md (opens in a new tab) |
| Event Functions · On-Demand — the trigger: SQS, DynamoDB Streams, SNS, Kinesis, filtering, batch failures | event-sources.md (opens in a new tab) |
| Event Functions · On-Demand — reserved or Provisioned Concurrency, throttling, ESM provisioned mode for stream or queue lag | concurrency.md (opens in a new tab) |
| Event Functions · On-Demand — SAM/CDK/CloudFormation resources and deployment | deployment.md (opens in a new tab) |
| Event Functions · On-Demand — wiring API Gateway, DynamoDB or VPC internet access | The SOPs below |
Route here when the user wants to coordinate multiple steps, services, or functions. Triggers include “orchestration”, “workflow”, “state machine”, “multi-step coordination”, “coordinate Lambda functions”, “durable execution”, “pipeline with retries”, a saga/compensation pattern, human approval, fan-out, or long-running async coordination.
When starting a new orchestration, surface AWS Lambda Durable Functions and AWS Step Functions before implementing unless the request already supplies a complete deciding fact. Retries, branching, waits, approvals, and a generic “on AWS” statement are shared orchestration signals, not state-machine signals: when these are all the request supplies, present both choices and their tradeoff up front, ask the implementation-model question, and do not choose either service yet. Resolve orchestration independently of compute and capacity. You can use Durable Functions as an orchestrator for MicroVMs.
Tradeoff (use when either fits): Durable Functions keeps orchestration in Lambda application code — Python 3.13+, Node.js 22+, Java 17+ or .NET 8+, with Rust and Go in preview — with checkpoint/replay (context.step / context.wait / context.invoke), retries, conditions, callbacks, and execution history. Durable executions can run up to 1 year on async invocations at zero cost while waiting; each step remains bounded by its Event Functions capacity-provider timeout. Step Functions externalizes orchestration into a managed visual state machine with 200+ native service integrations and Distributed Map (Standard executions up to 1 year, Express up to 5 minutes). Full comparison: orchestration.md (opens in a new tab); implementation belongs to the routed skill.
Choose the capability from the use case the request describes (trigger, event origin, topology, existing investment); do not ask EventBridge clarifying questions. Full details are in orchestration.md (opens in a new tab).
eventsv2) → amazon-eventbridge-event-bus.If steps must run in a defined order with checkpointed progress, retries, waits, or compensation, that is orchestration rather than eventing: decide Durable Functions vs Step Functions in Step 3.
Node.js HTTP server → Web Functions (Tier 1). When the request asks for an HTTP endpoint, API or webhook receiver without saying the runtime or server model and whether API management is needed, it is Leaning (Rule 3), and no runtime may be assumed: name the three options (Web Functions for a Node.js server, API Gateway in front of an Event Function, a Function URL for one function without API management), give the provisional default, and ask the runtime/server model and whether per-client rate limits, API keys, WAF or request validation are required. Otherwise put API Gateway HTTP API in front of Event Functions by default — up to ~70% lower per-request price than REST API and lower latency — and move to REST API only for its exclusive features (WAF, usage plans and API keys, request validation and transformation, caching, canary deployments, private or edge-optimized endpoints); say this cost/feature tradeoff explicitly when recommending an API front door. Persistent bidirectional connections → API Gateway WebSocket API; a single Event Function that needs an HTTPS endpoint without API management → Lambda Function URL. Front-door table, quotas and authorizers: api-gateway.md (opens in a new tab); wiring procedures: the API Gateway SOPs below.
| Use this skill | For the task |
|---|---|
| connecting-lambda-to-api-gateway | Wire an existing Lambda to a new REST/HTTP API: proxy integration, permissions, CORS, throttling, access logging, deployment |
| connecting-lambda-to-dynamodb | Connect Lambda to DynamoDB: IAM execution role, read/write permissions, stream event source mapping |
| creating-api-gateway-stage | Create an API Gateway stage with CloudWatch logging, X-Ray tracing, throttling, WAF association, and authorization |
| deploying-custom-domain-rest-api | Deploy a Regional REST API with custom domain: ACM cert, Lambda backend, request authorizer, base path mapping, Route 53 DNS |
| debugging-lambda-timeouts | Systematically diagnose a timing-out Lambda: config, CloudWatch logs/metrics, VPC, cold starts, memory, downstream calls |
| enabling-lambda-vpc-internet-access | Give a VPC-attached Lambda internet access: NAT Gateway, subnet routing, security groups |
| processing-s3-uploads-with-step-functions | Deploy an event-driven workflow: S3 upload → EventBridge → Step Functions → Lambda (small files) or Fargate (large files), with VPC/ECR/ECS/IAM |
| User need | Read |
|---|---|
| Tier 3 edge cases: duration ceilings, cold start vs stream lag, SnapStart and Provisioned Concurrency, steady-state Managed Instances, tenant isolation | compute-decision-edge-cases.md (opens in a new tab) |
| Patterns for a new serverless application once compute is chosen | architecture.md (opens in a new tab) |
| Lambda config, cold starts, SnapStart, memory, VPC, layers, Function URLs | lambda.md (opens in a new tab) |
| Concurrency (reserved, provisioned, ESM controls including provisioned mode) | concurrency.md (opens in a new tab) |
| Event sources (SQS, DynamoDB Streams, SNS, Kinesis), filtering, batch failures | event-sources.md (opens in a new tab) |
| Step Functions vs Durable Functions comparison, Standard vs Express, EventBridge capability table, rules/pipes/scheduler details | orchestration.md (opens in a new tab) |
| HTTP front-door table, API Gateway quotas, authorizers, WebSocket | api-gateway.md (opens in a new tab) |
| SAM/CDK resource types and fast iteration | deployment.md (opens in a new tab) |
| Production readiness, observability, anti-patterns | production.md (opens in a new tab) |
| Debugging an error (exact string → cause → fix) | troubleshooting.md (opens in a new tab) |
| Powertools handler template | powertools-handler.py (opens in a new tab) |
* resource policies on Function URLs or API Gateway (AuthType: NONE and open access are never defaults), encryption at rest for queues, streams and state, and CloudTrail plus CloudWatch alarms on errors and throttles.Note: Reference files contain specific runtime versions, quotas, pricing premiums and feature matrices that change. When precision matters (production, runtime choice, quotas), confirm against current AWS documentation. The references focus on values and gotchas that are easy to get wrong — not on basics.
This skill can be loaded two ways, and they resolve the skill’s own bundled files — the references/ documents and assets/powertools-handler.py — from different places. Determine how the skill was loaded before you read one:
retrieve_skill tool call. The skill is not installed on the local filesystem; its reference and asset files do not exist on disk. You MUST fetch each one through the same retrieve_skill tool by passing the file parameter (for example, file="references/lambda.md" or file="assets/powertools-handler.py"). Do NOT file_read these paths from the local or working directory, and do NOT search the filesystem for them — they are not there, and any local file that happens to match the name is unrelated to this skill..claude/skills/aws-serverless/, ~/.claude/skills/aws-serverless/, or .kiro/skills/aws-serverless/). Read references and assets from the local skill directory using the relative paths shown throughout this document.This distinction applies only to the skill’s own packaged files. The user’s application code — handlers, SAM/CDK templates, package.json, deployment artifacts — is always read from and written to the user’s working directory regardless of how the skill was loaded. Never fetch or write customer data through retrieve_skill.
Routes serverless requests to a compute form factor and the skill that owns it. Applies to Lambda, API Gateway, EventBridge, Step Functions and event-driven work while the compute, orchestration or integration choice is open — API backends, webhooks, jobs, cron, queue/stream consumers, durable workflows, event routing, Step Functions vs Durable Functions, and Pipes vs native event source mappings for queues and streams. Decides Event Functions on-demand vs Managed Instances, Web Functions, MicroVMs, EventBridge rules/Scheduler/Pipes/bus, HTTP vs REST API. Owns shared Lambda references (cold starts, SnapStart, concurrency, event sources, function URLs, throttling, troubleshooting). Defers to the specialized skill once a request commits to one form factor or service, or describes its defining feature without naming it (durable checkpointing and automatic step retries, Firecracker sandbox, managed instances, Node.js server). Not for EC2, ECS/EKS/Fargate or Amplify hosting.
The verbatim description from this skill’s front matter — the string an agent matches on to decide whether to load it.
skills/core-skills/aws-serverless/SKILL.mdmain, last pushed 7 November 2026.SKILL.md, not by matching a directory convention. 22 distinct layouts observed: plugins/aws-agents-for-devsecops/skills/*/SKILL.md, plugins/aws-agents/skills/*/SKILL.md, plugins/aws-core/skills/*/SKILL.md, plugins/aws-startup-advisor/skills/*/SKILL.md, skills/core-skills/*/SKILL.md, skills/specialized-skills/analytics-skills/*/SKILL.md, skills/specialized-skills/aws-marketplace-skills/*/SKILL.md, skills/specialized-skills/customer-communications-skills/*/SKILL.md, skills/specialized-skills/database-skills/*/SKILL.md, skills/specialized-skills/ec2-skills/*/SKILL.md, skills/specialized-skills/end-user-computing-skills/*/SKILL.md, skills/specialized-skills/media-services-skills/*/SKILL.md, skills/specialized-skills/migration-and-modernization-skills/*/SKILL.md, skills/specialized-skills/networking-and-content-delivery-skills/*/SKILL.md, skills/specialized-skills/operations-skills/*/SKILL.md, skills/specialized-skills/quantum-computing-skills/*/SKILL.md, skills/specialized-skills/resilience-skills/*/SKILL.md, skills/specialized-skills/security-and-identity-skills/*/SKILL.md, skills/specialized-skills/serverless-skills/*/SKILL.md, skills/specialized-skills/storage-skills/*/SKILL.md, skills/specialized-skills/system-table-skills/*/SKILL.md, skills/specialized-skills/web-and-mobile-development/*/SKILL.md.h1 and no skipped levels:.claude-plugin/marketplace.json by Amazon Web Services, declaring 5 plugins. It is read for editorial metadata only — never as the skill index, which is always the repository tree./aws/agent-toolkit-for-aws.md, and each skill at its own .md URL.11 files · 84 KB
Everything this skill ships beside its prose. All of it is set here, as subchapters of skill 56.
Documentation the agent loads on demand, rather than up front.
Templates, schemas and fixtures the skill draws on.