Lambda 30 Minute Timeout: The Limits That Did Not Move
AWS doubled the Lambda timeout to 1,800 seconds on 19 November 2026. API Gateway, SDK read timeouts, three kinds of event source mapping and the Terraform provider still stop short of it, and here is how to find each one before you raise the number.
By VVV Ops ·
AWS raised the maximum timeout for Lambda Event Functions from 900 to 1,800 seconds on 19 November 2026, for synchronous, asynchronous and event source mapping invocations (AWS Compute Blog). Changing the number on the function takes one CLI call. Several things around the function were sized for the old 15-minute ceiling and keep their own limits: the services and SDK clients that call it, three kinds of event source mapping, and, as of 29 November, the Terraform AWS provider, which still refuses any value above 900.
This post is the audit we would run before raising timeouts across an account. For the SQS side of long-running consumers (batch size, reserved concurrency and how the visibility timeout has to cover retries) see our post on draining an SQS backlog with Lambda; for how Step Functions timeouts can skip your failure handling, see the staging sync write-up. Neither is repeated here.
Which invocation paths get 1,800 seconds
The ceiling depends on how the function is invoked and where it runs. On-demand Event Functions now accept up to 1,800 seconds on all three invocation types. On Lambda Managed Instances, synchronous calls also get 30 minutes, while asynchronous and event source mapping invocations keep the 90-minute (5,400 second) limit AWS announced in September 2026. Lambda rejects anything higher with a validation error. The Lambda quotas page now lists the function timeout as 1,800 seconds.
| Path | Longest a single call can run | Who holds the limit | |---|---|---| | On-demand, sync, async or ESM | 30 minutes | Lambda | | Managed Instances, async or ESM | 90 minutes | Lambda | | Amazon MQ and DocumentDB event source mappings | 14 minutes | Lambda ESM | | Kafka ESM created before 19 Nov 2026, not in provisioned mode | 14 minutes | Lambda ESM | | REST API integration (default) | 29 seconds | API Gateway | | HTTP API integration | 30 seconds | API Gateway | | Step Functions Express workflow | 5 minutes | Step Functions | | Init phase, on demand | 10 seconds (unchanged) | Lambda |
The new value applies only to invocations that start after you update the function, and AWS says event source mappings can take a few minutes to pick it up. Durable functions are a separate setting: --timeout bounds each invocation, and the durable execution timeout bounds the whole run, up to a year for asynchronous invocations.
Start with the functions already sitting at or near the old ceiling, because those are the ones somebody will want to raise:
aws lambda list-functions \
--query 'Functions[?Timeout>=`840`].[FunctionName,Timeout]' \
--output text
Callers that give up first
A synchronous caller applies its own timeout, and AWS's launch post says to check that the caller supports the longer duration before raising the function's. API Gateway is the common case. REST API integrations run from 50 milliseconds to 29 seconds by default; you can request more for Regional and private APIs, but the API Gateway quotas page warns this may cost you part of your Region-level throttle quota, and edge-optimized APIs cannot be raised at all. HTTP APIs stop at 30 seconds with no increase (HTTP API quotas). A function behind either one gains nothing from 1,800 seconds except the ability to keep running, and billing, after the client has already received a gateway timeout.
Step Functions Express workflows run for at most five minutes, so the longer timeout is useful only from Standard workflows, which is where AWS says it applies.
Your own code is the caller that gets missed. The botocore default read_timeout is 60 seconds, and so is the AWS CLI's --cli-read-timeout (CLI reference). AWS's SDK reference says the SDKs retry transient errors such as network timeouts, and the standard-mode default of 3 max attempts means one request plus up to two retries (AWS SDKs retry behavior). Lambda's retry documentation says it does not retry direct invocations itself and that the function may have run completely, partially or not at all when the caller sees an error. A client that gives up at 60 seconds on a 20-minute function and then retries is starting a second run of the same event, so we set the read timeout past the function timeout and turn SDK retries off for long synchronous invokes:
import boto3
from botocore.config import Config
# Read timeout just above a 1,800 s function timeout, TCP keep-alive on (botocore
# leaves it off by default), and no SDK-level retries, because a retried Invoke
# is a second execution of the same event.
lambda_client = boto3.client(
"lambda",
config=Config(
read_timeout=1860,
connect_timeout=10,
tcp_keepalive=True,
retries={"total_max_attempts": 1},
),
)
For the CLI, pass --cli-read-timeout 1860 on aws lambda invoke. Long synchronous calls also need TCP keep-alive on the client, which comes up again below.
Event source mappings still held to 14 minutes
Three kinds of event source mapping did not get the new ceiling. Amazon MQ (ActiveMQ and RabbitMQ) and Amazon DocumentDB mappings support functions with a timeout of 14 minutes at most. Kafka mappings, Amazon MSK and self-managed, that were created before 19 November 2026 and do not use provisioned mode are held to the same 14 minutes. AWS's guidance for all of these is to keep the function timeout at 840 seconds or less.
For Kafka there are two ways out: create a new event source mapping, or switch the existing one to provisioned mode. Provisioned mode bills for event pollers on top of invocations (Kafka scaling modes), so price it before you flip it on a busy topic. The ListEventSourceMappings response carries a LastModified time but no creation date, so you cannot tell from the API alone which side of 19 November a mapping sits on. We treat every Kafka mapping without a ProvisionedPollerConfig as capped:
aws lambda list-event-source-mappings \
--query 'EventSourceMappings[].[FunctionArn,EventSourceArn,SelfManagedEventSource.Endpoints.KAFKA_BOOTSTRAP_SERVERS[0],ProvisionedPollerConfig.MinimumPollers]' \
--output text
Rows whose source ARN contains :mq: or points at a DocumentDB cluster (those ARNs use the rds namespace, arn:aws:rds:...:cluster:...), and any Kafka row with None in the last column, belong to functions that stay at 840 seconds. Moving a Kafka mapping to provisioned mode is one call:
aws lambda update-event-source-mapping \
--uuid <mapping-uuid> \
--provisioned-poller-config MinimumPollers=1,MaximumPollers=10
SQS mappings did get 30 minutes, with a cost in queue settings. AWS recommends a visibility timeout of at least six times the function timeout plus MaximumBatchingWindowInSeconds (Lambda SQS configuration), which is at least 10,800 seconds, three hours, for an 1,800-second function. A message whose run fails therefore stays invisible for about three hours before Lambda receives it again. SQS caps visibility at 12 hours from first receipt. Lambda enforces less than that recommendation. It only checks that the function timeout does not exceed the queue's visibility timeout, and only when you create or update the mapping. It does not check when you change the function timeout, so raising only the function leaves the old visibility timeout in place with nothing to flag it.
On Kinesis and DynamoDB Streams, Lambda reads one batch per shard at a time by default, so a longer invocation slows the shard. AWS's advice is to watch IteratorAge, raise the parallelization factor if records back up, and turn on partial batch failure reporting so a failure late in a long batch does not replay the whole batch.
Terraform still rejects anything above 900
The Terraform AWS provider validates timeout on aws_lambda_function with validation.IntBetween(1, 900). That check is still in internal/service/lambda/function.go on main as of 29 November 2026, and 6.74.0 (23 November) is the latest release in the changelog. A plan with timeout = 1800 fails before any API call. Issue #50718, opened in October for the 90-minute Managed Instances limit, quotes the error:
expected timeout to be in the range (1 - 900), got 2000
PR #51180, opened 20 November, raises the bound to 5,400 and had no maintainer review when we checked. CloudFormation, SAM and CDK do not have this problem: AWS's launch post uses Timeout: 1800 in a SAM template, and the CDK Function construct passes the duration through without an upper-bound check.
Until a provider release ships the fix, the stopgap we would use is to keep the config value legal, tell Terraform not to manage the field, and set the real value out of band:
# Illustrative: report_builder stands in for your function.
resource "aws_lambda_function" "report_builder" {
# ...
timeout = 900 # provider validates 1-900; real value set with the CLI
lifecycle {
ignore_changes = [timeout]
}
}
aws lambda update-function-configuration \
--function-name report-builder \
--timeout 1800
Run terraform plan afterwards and confirm it shows no change to the function. Put a comment linking the PR next to the ignore_changes so somebody removes it, and sets timeout = 1800 in code, once the provider accepts it. The out-of-band value is drift your repository does not record, which is the problem the SQS post above spends a section on.
Concurrency, retries and the bill for a hung call
Concurrency is requests per second times average duration. At one request per second, a function averaging 30 minutes needs 1,800 concurrent executions, against a default account quota of 1,000 per Region. Doubling the duration of a busy function doubles its share of that pool, and every other function in the account and Region draws on the same pool.
The more common way to reach the full 30 minutes is a function that hangs. A NAT gateway drops a connection that has been idle for 350 seconds, and a function blocked on a dropped connection can wait there until the timeout ends it. AWS's launch post lists the fixes: keep-alives through the NAT gateway, idle timeouts on RDS, ElastiCache and external APIs that cover the full duration, a short DNS TTL (it suggests 5 seconds for the JVM), and temporary credentials or tokens that stay valid for the whole run or are refreshed in the background.
What a hang costs follows from the price and the retry policy. At $0.0000166667 per GB-second, the x86 rate in the US East (N. Virginia) examples on the Lambda pricing page, a 2,048 MB function that runs to an 1,800-second timeout uses 3,600 GB-seconds, about $0.06 per call, against $0.03 at 900 seconds. A timeout counts as a function error for asynchronous invocations, and Lambda retries those twice by default, so one bad event can bill 90 minutes and about $0.18. Cents per event become a line item when a downstream outage makes every event hang. For asynchronous functions that hit the new limit, we would set MaximumRetryAttempts deliberately with aws lambda put-function-event-invoke-config and send failures to a destination you watch.
Longer runs also widen the window for duplicate delivery. Lambda does not promise exactly-once processing, so anything that writes money or records needs an idempotency key; AWS points to Powertools for AWS Lambda, and to execution names for durable functions.
Which functions we would raise
We would raise the timeout on idempotent work fed by SQS or asynchronous events that currently fails at 900 seconds: report builds, file conversions, ETL steps. For those, a failed run means the message returns to the queue and starts over, which AWS describes as often enough. Where a rerun is expensive, we would pair the higher timeout with durable functions so a 25-minute job that fails at minute 22 resumes from its last checkpoint instead of starting again, as AWS's own example puts it. Functions behind API Gateway, behind Express workflows, or on MQ, DocumentDB and older Kafka mappings stay where they are; for HTTP callers, the pattern we use is to accept the request, invoke the work asynchronously, and return an ID the client can poll.
If you want this audit run across your accounts, get in touch. We would start with the event source mapping listing above and every SDK client that calls Invoke synchronously, because those two decide whether a raised timeout runs to completion or gets retried as a duplicate.