/aws-lambda-managed-instances
Evaluate, configure, and migrate workloads to AWS Lambda Managed Instances (LMI). Triggers on: Lambda Managed Instances, LMI, capacity provider, multi-concurrency Lambda, dedicated instance Lambda, EC2-backed Lambda, cold start elimination, Graviton Lambda, instance type for
$ npx -y skills add awslabs/agent-plugins --skill aws-lambda-managed-instances --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
- Fires itselfAuto-invocation. Claude auto-loads it when your prompt matches the work.Auto-invocation is when the right skill fires by itself at the right moment, driven by a FLOW.md router and a hook, instead of you invoking it by name. It is the difference between a skill being installed and a skill actually getting used.Read the full definition →
- You can call itInvoke it directly when you want it.
- Slash command
/aws-lambda-managed-instances
Context preview
The summary Claude sees to decide when to auto-load this skill.
Evaluate, configure, and migrate workloads to AWS Lambda Managed Instances (LMI). Triggers on: Lambda Managed Instances, LMI, capacity provider, multi-concurrency Lambda, dedicated instance Lambda, EC2-backed Lambda, cold start elimination, Graviton Lambda, instance type for
SKILL.md
aws-lambda-managed-instances.SKILL.mdname: aws-lambda-managed-instances
description: >
Evaluate, configure, and migrate workloads to AWS Lambda Managed Instances (LMI).
Triggers on: Lambda Managed Instances, LMI, capacity provider, multi-concurrency Lambda,
dedicated instance Lambda, EC2-backed Lambda, cold start elimination, Graviton Lambda,
instance type for Lambda, scheduled scaling for LMI, Lambda cost optimization with
Reserved Instances or Savings Plans. Also trigger when users describe high-volume
predictable workloads seeking cost savings, want to scale LMI capacity on a schedule,
or compare Lambda vs EC2 for steady-state traffic. For standard Lambda without LMI,
use the aws-lambda skill instead.
argument-hint: "[describe your workload or what you need help with]"
metadata:
tags: lambda, lmi, managed-instances, ec2, capacity-provider, multi-concurrency, cost-optimization, scheduled-scaling
AWS Lambda Managed Instances (LMI)
Run Lambda functions on current-generation EC2 instances in your account while AWS manages provisioning, patching, scaling, routing, and load balancing. Combines Lambda's developer experience with EC2's pricing and hardware options.
For standard Lambda development, see [aws-lambda skill](../aws-lambda/). For SAM/CDK deployment, see [aws-serverless-deployment skill](../aws-serverless-deployment/).
When to Load Reference Files
- **Cost comparison**, **pricing analysis**, **Lambda vs LMI cost**, **Savings Plans**, or **Reserved Instances** -> see [references/cost-comparison.md](references/cost-comparison.md)
- **Instance types**, **memory sizing**, **vCPU ratios**, **scaling tuning**, **scheduled scaling**, or **capacity provider config** -> see [references/configuration-guide.md](references/configuration-guide.md)
- **Thread safety**, **concurrency model**, **code review checklist**, **Powertools compatibility**, or **multi-concurrency readiness** -> see [references/thread-safety.md](references/thread-safety.md)
- **Before/after code examples**, **runtime-specific migration** (Node.js, Python, Java, .NET), or **connection pooling** -> see [references/migration-patterns.md](references/migration-patterns.md)
- **IAM roles**, **VPC setup**, **CLI commands**, **SAM template**, **CDK example**, or **scheduled scaling setup (EventBridge Scheduler)** -> see [references/infrastructure-setup.md](references/infrastructure-setup.md) and [scripts/setup-lmi.sh](scripts/setup-lmi.sh)
- **Errors**, **throttling**, **debugging**, **stuck deployments**, **tuning configuration**, or **adjusting after deployment** -> see [references/troubleshooting.md](references/troubleshooting.md)
Quick Decision: Is LMI Right for This Workload?
| Signal | LMI is a strong fit | Standard Lambda is better | | -------------- | --------------------------------------------------------------------------------------- | ------------------------------------------------------ | | Traffic | Steady, predictable, 50M+ req/mo | Bursty, unpredictable, long idle | | Cost | Duration-heavy spend at scale | Low or sporadic invocations | | Cold starts | Unacceptable (LMI eliminates for provisioned capacity; scale-out may have brief delays) | Tolerable or mitigated by SnapStart | | Compute | Latest CPUs, specific families, high network bandwidth | Standard Lambda memory/CPU sufficient | | Isolation | Dedicated EC2 instances in your account, full VPC control | Shared Firecracker micro-VMs acceptable | | Scale-to-zero | Not needed (execution environments always running) | Required (pay nothing when idle) | | Code readiness | Thread-safe (Node.js/Java/.NET) or any Python code | Non-thread-safe Node.js/Java/.NET, expensive to change |
Instructions
Step 1: Assess the Workload
Gather these signals before recommending:
1. **Traffic pattern**: Steady vs bursty? Requests per second? 2. **Current costs**: Monthly Lambda spend? Existing Savings Plans? 3. **Runtime**: Node.js, Java, .NET, or Python? 4. **Memory/CPU**: How much memory? CPU-bound or I/O-bound? 5. **Execution duration**: Average and P99? 6. **Concurrency readiness**: Thread safety (Node.js/Java/.NET)? Shared `/tmp` paths? Per-invocation DB connections? 7. **VPC**: Already in a VPC? Private resource access needed?
Deriving LMI Configuration from Metrics
If Lambda Insights is enabled on the function, use these metrics to calculate your starting configuration. If Lambda Insights is not enabled, suggest adding it to gather accurate workload data — but only proceed with the user's explicit confirmation, as adding the Insights layer may affect function performance or cold start times.
To check if Lambda Insights is enabled, look for a LambdaInsightsExtension layer on the function. To add it, find the latest layer ARN for your region from the [Lambda Insights documentation](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/Lambda-Insights-extension-versions.html) and attach the `CloudWatchLambdaInsightsExecutionRolePolicy` managed policy to the function's execution role.
**Target max concurrency** (from `cpu_total_time` and `Duration`):
PerExecutionEnvironmentMaxConcurrency = floor((0.5 × Duration) / cpu_total_time)
This targets 50% CPU utilization at full concurrency, leaving headroom for scaling.
**Memory allocation** (from `memory_utilization` and current memory):
MemorySize = min(32768, max(2048, MaxConcurrency × (memory_utilization / 100) × current_allocated_memory))
This overestimates (assumes no shared base
Read more
name: aws-lambda-managed-instances description: > Evaluate, configure, and migrate workloads to AWS Lambda Managed Instances (LMI). Triggers on: Lambda Managed Instances, LMI, capacity provider, multi-concurrency Lambda, dedicated instance Lambda, EC2-backed Lambda, cold start elimination, Graviton Lambda, instance type for Lambda, scheduled scaling for LMI, Lambda cost optimization with Reserved Instances or Savings Plans. Also trigger when users describe high-volume predictable workloads seeking cost savings, want to scale LMI capacity on a schedule, or compare Lambda vs EC2 for steady-state traffic. For standard Lambda without LMI, use the aws-lambda skill instead. argument-hint: "[describe your workload or what you need help with]" metadata: tags: lambda, lmi, managed-instances, ec2, capacity-provider, multi-concurrency, cost-optimization, scheduled-scaling
AWS Lambda Managed Instances (LMI)
Run Lambda functions on current-generation EC2 instances in your account while AWS manages provisioning, patching, scaling, routing, and load balancing. Combines Lambda's developer experience with EC2's pricing and hardware options.
For standard Lambda development, see [aws-lambda skill](../aws-lambda/). For SAM/CDK deployment, see [aws-serverless-deployment skill](../aws-serverless-deployment/).
When to Load Reference Files
- **Cost comparison**, **pricing analysis**, **Lambda vs LMI cost**, **Savings Plans**, or **Reserved Instances** -> see [references/cost-comparison.md](references/cost-comparison.md)
- **Instance types**, **memory sizing**, **vCPU ratios**, **scaling tuning**, **scheduled scaling**, or **capacity provider config** -> see [references/configuration-guide.md](references/configuration-guide.md)
- **Thread safety**, **concurrency model**, **code review checklist**, **Powertools compatibility**, or **multi-concurrency readiness** -> see [references/thread-safety.md](references/thread-safety.md)
- **Before/after code examples**, **runtime-specific migration** (Node.js, Python, Java, .NET), or **connection pooling** -> see [references/migration-patterns.md](references/migration-patterns.md)
- **IAM roles**, **VPC setup**, **CLI commands**, **SAM template**, **CDK example**, or **scheduled scaling setup (EventBridge Scheduler)** -> see [references/infrastructure-setup.md](references/infrastructure-setup.md) and [scripts/setup-lmi.sh](scripts/setup-lmi.sh)
- **Errors**, **throttling**, **debugging**, **stuck deployments**, **tuning configuration**, or **adjusting after deployment** -> see [references/troubleshooting.md](references/troubleshooting.md)
Quick Decision: Is LMI Right for This Workload?
| Signal | LMI is a strong fit | Standard Lambda is better | | -------------- | --------------------------------------------------------------------------------------- | ------------------------------------------------------ | | Traffic | Steady, predictable, 50M+ req/mo | Bursty, unpredictable, long idle | | Cost | Duration-heavy spend at scale | Low or sporadic invocations | | Cold starts | Unacceptable (LMI eliminates for provisioned capacity; scale-out may have brief delays) | Tolerable or mitigated by SnapStart | | Compute | Latest CPUs, specific families, high network bandwidth | Standard Lambda memory/CPU sufficient | | Isolation | Dedicated EC2 instances in your account, full VPC control | Shared Firecracker micro-VMs acceptable | | Scale-to-zero | Not needed (execution environments always running) | Required (pay nothing when idle) | | Code readiness | Thread-safe (Node.js/Java/.NET) or any Python code | Non-thread-safe Node.js/Java/.NET, expensive to change |
Instructions
Step 1: Assess the Workload
Gather these signals before recommending:
1. **Traffic pattern**: Steady vs bursty? Requests per second? 2. **Current costs**: Monthly Lambda spend? Existing Savings Plans? 3. **Runtime**: Node.js, Java, .NET, or Python? 4. **Memory/CPU**: How much memory? CPU-bound or I/O-bound? 5. **Execution duration**: Average and P99? 6. **Concurrency readiness**: Thread safety (Node.js/Java/.NET)? Shared `/tmp` paths? Per-invocation DB connections? 7. **VPC**: Already in a VPC? Private resource access needed?
Deriving LMI Configuration from Metrics
If Lambda Insights is enabled on the function, use these metrics to calculate your starting configuration. If Lambda Insights is not enabled, suggest adding it to gather accurate workload data — but only proceed with the user's explicit confirmation, as adding the Insights layer may affect function performance or cold start times.
To check if Lambda Insights is enabled, look for a LambdaInsightsExtension layer on the function. To add it, find the latest layer ARN for your region from the [Lambda Insights documentation](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/Lambda-Insights-extension-versions.html) and attach the `CloudWatchLambdaInsightsExecutionRolePolicy` managed policy to the function's execution role.
**Target max concurrency** (from `cpu_total_time` and `Duration`):
PerExecutionEnvironmentMaxConcurrency = floor((0.5 × Duration) / cpu_total_time)
This targets 50% CPU utilization at full concurrency, leaving headroom for scaling.
**Memory allocation** (from `memory_utilization` and current memory):
MemorySize = min(32768, max(2048, MaxConcurrency × (memory_utilization / 100) × current_allocated_memory))
This overestimates (assumes no shared base
Read this in other languages: 日本語 Generative AI can make mistakes. You should consider reviewing all output and costs generated by your chosen AI model and agentic coding assistant. See AWS Responsible AI Policy.
Other skills on agent-plugins.
- /amazon-location-service
Integrates Amazon Location Service APIs for AWS applications. Use this skill when users want to add maps (interactive MapLibre or static images); geocode addresses to coordinates or reverse geocode coordinates to addresses; calculate routes, travel times, or service areas; find
Open skill - /amplify-workflow
Build and deploy full-stack web and mobile apps with AWS Amplify Gen2
Open skill - /api-gateway
Build, manage, and operate APIs with Amazon API Gateway (REST, HTTP, and WebSocket). Triggers on phrases like: API Gateway, REST API, HTTP API, WebSocket API, custom domain, Lambda authorizer, usage plan, throttling, CORS, VPC link, private API. Also covers troubleshooting API
Open skill - /aws-lambda-durable-functions
Build resilient, long-running, multi-step applications with AWS Lambda durable functions with automatic state persistence, retry logic, and orchestration for long-running executions. Covers the critical replay model, step operations, wait/callback patterns, error handling with
Open skill - /aws-lambda-microvms
Build, run, debug, and operate applications on AWS Lambda MicroVMs — Firecracker-isolated, snapshot-resumable serverless compute environments that run inside a container with up to 8-hour lifetimes. Triggers on: Lambda MicroVMs, Firecracker isolation, snapshot-resumable compute,
Open skill - /aws-lambda
Design, build, deploy, test, and debug serverless applications with AWS Lambda. Triggers on phrases like: Lambda function, event source, serverless application, API Gateway, EventBridge, Step Functions, serverless API, event-driven architecture, Lambda trigger. For deploying
Open skill

