Lambda functions now support a maximum 90-minute timeout setting for asynchronous invocations of LMI, so I tried verifying continuous operation exceeding 15 minutes
This page has been translated by machine translation. View original
Introduction
On September 9, 2026, it became possible to set timeouts of up to 90 minutes for asynchronous invocations of Lambda functions using Lambda Managed Instances (LMI).
This applies to asynchronous invocations on LMI and invocations via Event Source Mapping (ESM). Synchronous invocations remain limited to a maximum of 15 minutes as before.
In this article, we will verify that a Lambda function using LMI can be invoked asynchronously and run for more than 15 minutes.
Verification Details
In an LMI environment with a Capacity Provider using m6g.large, we deploy a Lambda function that runs for 16 minutes. We invoke it asynchronously with InvocationType=Event and confirm continuous operation beyond 15 minutes in CloudWatch Logs. For setting up the LMI environment, please refer to the previous article using CDK.
Creating the Lambda Function
To create a Lambda function that uses LMI, you need to specify --capacity-provider-config when running create-function. In this verification, we were unable to add a Capacity Provider after the fact to an already created function using update-function-configuration.
For this verification, we prepared a function that prints the current time to standard output every 10 seconds for 16 minutes.
import time
from datetime import datetime, timezone
def handler(event, context):
"""
Prints the current time to standard output every 10 seconds for 16 minutes.
For demonstrating the 90-minute timeout on LMI (confirming operation beyond 15 minutes).
"""
duration_seconds = 16 * 60 # 16 minutes
interval = 10
start = time.time()
print(f"[START] {datetime.now(timezone.utc).isoformat()} duration={duration_seconds}s interval={interval}s", flush=True)
tick = 0
while time.time() - start < duration_seconds:
elapsed = time.time() - start
now = datetime.now(timezone.utc).isoformat()
print(f"[TICK] {now} elapsed={elapsed:.1f}s tick={tick}", flush=True)
time.sleep(interval)
tick += 1
total_elapsed = time.time() - start
print(f"[DONE] {datetime.now(timezone.utc).isoformat()} total_elapsed={total_elapsed:.1f}s", flush=True)
return {"status": "completed", "duration_seconds": duration_seconds, "total_elapsed": total_elapsed}
Save this code as handler.py, package it into a ZIP file, and then create the function. To allow enough headroom for the 16-minute loop, set the timeout to 20 minutes (1200 seconds).
# Package the function code into a ZIP file
zip function.zip handler.py
# Create the function with the Capacity Provider attached and a timeout of 20 minutes (1200 seconds)
aws lambda create-function \
--function-name lmi-90min-test \
--runtime python3.13 \
--architectures arm64 \
--role arn:aws:iam::123456789012:role/lmi-90min-test-lambda-exec-role \
--handler handler.handler \
--timeout 1200 \
--memory-size 2048 \
--zip-file fileb://function.zip \
--capacity-provider-config '{"LambdaManagedInstancesCapacityProviderConfig":{"CapacityProviderArn":"arn:aws:lambda:ap-northeast-1:123456789012:capacity-provider:lmi-90min-test","PerExecutionEnvironmentMaxConcurrency":16,"ExecutionEnvironmentMemoryGiBPerVCpu":2.0}}' \
--region ap-northeast-1
# Publish a version (may take a few minutes to become Active)
aws lambda publish-version \
--function-name lmi-90min-test \
--region ap-northeast-1
Once publish-version completes and the version's State becomes Active, it is ready to be invoked.
Asynchronous Invocation
Since the LMI Capacity Provider is attached to a version, invoke using the version number published by publish-version rather than $LATEST.
# Set VERSION to the version number obtained from publish-version (e.g., 1)
VERSION=1
aws lambda invoke \
--function-name lmi-90min-test:${VERSION} \
--invocation-type Event \
--payload '{}' \
/tmp/invoke-response.json \
--region ap-northeast-1
An asynchronous invocation with InvocationType=Event immediately returns 202 (Accepted), and the function continues running in the background.
Checking CloudWatch Logs
Wait approximately 16 minutes for the function to complete, then check the CloudWatch Logs log group /aws/lambda/lmi-90min-test.
[START] 2026-09-10T01:05:20.310130+00:00 duration=960s interval=10s
[TICK] 2026-09-10T01:05:20.310198+00:00 elapsed=0.0s tick=0
[TICK] 2026-09-10T01:05:30.310319+00:00 elapsed=10.0s tick=1
[TICK] 2026-09-10T01:05:40.310468+00:00 elapsed=20.0s tick=2
...(omitted: tick=3 through 88 output every 10 seconds)...
[TICK] 2026-09-10T01:20:10.323429+00:00 elapsed=890.0s tick=89
[TICK] 2026-09-10T01:20:20.323577+00:00 elapsed=900.0s tick=90
[TICK] 2026-09-10T01:20:30.323723+00:00 elapsed=910.0s tick=91
[TICK] 2026-09-10T01:20:40.323867+00:00 elapsed=920.0s tick=92
[TICK] 2026-09-10T01:20:50.324017+00:00 elapsed=930.0s tick=93
[TICK] 2026-09-10T01:21:00.324167+00:00 elapsed=940.0s tick=94
[TICK] 2026-09-10T01:21:10.324317+00:00 elapsed=950.0s tick=95
[DONE] 2026-09-10T01:21:20.324472+00:00 total_elapsed=960.0s
Log output continued past 15 minutes (900 seconds), and the function completed at 16 minutes (960 seconds). The execution time recorded in platform.report was 960017.172 milliseconds, and the status was successful.
Summary
For Lambda functions invoked asynchronously in an LMI environment, the timeout can be set up to a maximum of 90 minutes, and this verification confirmed that the function ran for 16 minutes, exceeding the 15-minute limit.
However, with LMI, in addition to request-based charges and EC2 instance fees, a 15% compute management fee is added on top of the EC2 on-demand price.
When running Lambda functions for extended periods with LMI, we recommend carefully evaluating the solution, including the fact that the pricing model differs from standard Lambda.
