Skip to content
Development
Skill

/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

From plugin
agent-plugins
85734 skills8 MCP
Install
$ npx -y skills add awslabs/agent-plugins --skill aws-lambda-managed-instances --agent claude-code

How 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.md
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 more
Ships withagent-plugins

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.

Get the whole plugin

Other skills on agent-plugins.