All skills
aws avatar

/aws-lambda-managed-instances

@e4f4c39

Evaluates, configures, and migrates workloads to AWS Lambda Managed Instances (LMI). Runs Lambda functions on EC2 instances in the user's account while AWS manages provisioning, patching, scaling, routing, and load balancing. Triggers when queries mention Lambda Managed Instances, LMI, capacity providers, multi-concurrent execution environments, EC2-backed Lambda, persistent Lambda instances, PerExecutionEnvironmentMaxConcurrency, CapacityProviderConfig, cold start elimination via dedicated instances, migrating standard Lambda to managed instances, or cost comparison between standard Lambda and LMI with Savings Plans or Reserved Instances. Also covers long-running and asynchronous workloads and the 90-minute (5400s) function timeout for asynchronous and event-source-mapping (SQS, Kinesis, DynamoDB Streams / ESM) invocations, including how to raise the function timeout up to 90 minutes / 5400s and the related duration limits.

Use this Skill: https://skilld.dev/gh/aws/agent-toolkit-for-aws/aws-lambda-managed-instances

This session only. Nothing lands on disk.

referencestroubleshooting.md

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

LMI Troubleshooting

Common Issues

Issue Cause Resolution
429 throttles during scale-up Traffic doubled faster than 5-min scaling window Increase MinExecutionEnvironments or lower TargetResourceUtilization
Function stuck in PENDING Capacity provider provisioning instances Wait several minutes; verify VPC subnets have IP capacity and IAM roles are correct
Architecture mismatch error Function architecture ≠ capacity provider Align both to arm64 or x86_64
Cannot terminate EC2 instances LMI instances managed by capacity provider Delete capacity provider to destroy instances; cannot use EC2 console
High CPU, low throughput Concurrency too high for CPU-bound work Reduce PerExecutionEnvironmentMaxConcurrency to 1/vCPU
Race conditions in production Code not thread-safe for multi-concurrency Review with checklist in thread-safety.md
Function version not ACTIVE Fewer than 3 execution environments ready Wait for provisioning; check capacity provider status
Unexpected 500 errors Unhandled concurrent access to shared state Add thread-safe patterns from migration-patterns.md
CloudWatch logs missing VPC egress not configured Add NAT Gateway or CloudWatch Logs VPC endpoint
High costs despite low traffic Minimum 3 instances always running Evaluate if standard Lambda is more cost-effective

Debugging Steps

Throttling Issues

  1. Check throttles metric for the reason for throttles

Function Not Starting

  1. Check capacity provider status: aws lambda get-capacity-provider --capacity-provider-name <name>

  2. Verify subnets span 3+ AZs with available IPs

  3. Confirm security group allows necessary egress

  4. Check operator role has required permissions

  5. Check for LMI-managed instances:

    aws ec2 describe-instances --filters "Name=tag-key,Values=aws:lambda:capacity-provider" \
      --query "Reservations[].Instances[].{Id:InstanceId,State:State.Name}"

Performance Issues

  1. Check CloudWatch metrics (5-min intervals): CPU utilization, memory, concurrency/env
  2. If CPU > 80%: reduce concurrency or add vCPUs (increase memory with appropriate ratio)
  3. If throttles > 1%: increase MinExecutionEnvironments
  4. If CPU < 20%: increase concurrency — resources are underutilized
  5. For Python: verify 4:1 or 8:1 ratio (GIL limits CPU parallelism)

Cost Issues

  1. Verify instance count matches actual need (not over-provisioned)
  2. Check if Savings Plans or RIs are applied to these instances
  3. Compare actual costs against the LMI Pricing Calculator
  4. If traffic is lower than expected, consider reducing MaxVCpuCount
  5. For dev/test: use ExcludedInstanceTypes to avoid expensive instance families

Source: SKILL.md on GitHub

1 alert24d3 checks · Risk CRITICAL
  • Gen Agent Trust Hub24d

    This skill includes some security considerations such as indirect prompt injection surfaces and external resource references. These elements are consistent with the skill's purpose for AWS workload management and follow standard vendor practices. See detailed analysis for context.

  • Socket24d

    No alerts

  • Snyk24d

    Risk: MEDIUM · 1 issue

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

Last checked against GitHub yesterday.

Activeupdated 4 weeks ago
version
2

README badge

README badge for aws/agent-toolkit-for-aws/aws-lambda-managed-instances