AWS Lambda 30-Minute Timeout: How to Set It and What Breaks

Logeshwaran
—

AWS Lambda functions can now run for up to 30 minutes instead of 15; this guide shows how to raise the timeout, what else you have to change (API Gateway, SQS, SDK clients, retries), what it costs, and when a longer function is the wrong fix.

⚡ Quick Answer

• New limit (November 19, 2026): 30 minutes (1,800 seconds) for on-demand Event Functions, for synchronous, asynchronous and event source mapping calls. All commercial Regions, no extra charge.

• How: aws lambda update-function-configuration --function-name NAME --timeout 1800

• Change first: SQS visibility timeout to 3 hours, client read timeouts above 30 minutes, async retry settings.

• Still capped: API Gateway (29-30 seconds), Web Functions (15 minutes), Amazon MQ, DocumentDB and older Kafka mappings (14 minutes).

• Longer still: 90 minutes for async and event source mapping calls on Lambda Managed Instances; durable functions for workflows up to a year.

Jump to: Basics · All the limits · How to set it · Callers that time out first · Cost · FAQ

Here’s the trap waiting for most people: raising the timeout to 30 minutes doesn’t help a function behind API Gateway at all. API Gateway stops waiting after 29 seconds (REST APIs, by default) or 30 seconds (HTTP APIs), returns an error to the user, and your function keeps running, and billing, in the background. And an asynchronous function that times out is retried twice by default, so a stuck job now burns 90 minutes and three times the cost before it lands in your dead-letter queue.

Jake had been proud of his workaround: the shop’s nightly sales report ran as three Lambda functions in a chain, because the whole thing took 22 minutes and Lambda stopped at 15.

Jake: "So I can glue my three functions back into one now?"

Ethan: "Probably. But first we check what calls it, what queue feeds it, and what happens when it fails at minute 25."

New to Lambda timeouts? The plain-English version

  • AWS Lambda runs your code without servers. Each run is an invocation, and the timeout is the longest one run may take before Lambda stops it.
  • The default is still 3 seconds, which is why “Task timed out after 3.00 seconds” is such a common error (our fix for it). You raise it per function.
  • The maximum has grown over the years: 60 seconds in 2014, 5 minutes in 2015, 15 minutes in 2018, and now 30 minutes after eight years at 15.
  • Event Functions are classic Lambda functions triggered by events, API calls or queues. Lambda now also has Web Functions (HTTP servers) and MicroVMs (isolated sandboxes), each with its own limit.
  • Lambda Managed Instances runs Event Functions on EC2 capacity that Lambda manages for you, for steady traffic; it has longer limits for some invocation types.
  • You pay for duration, so a longer timeout costs nothing by itself; it only costs money when functions actually run longer.

The maximum timeout over the years

YearMaximumWhat it meant
201460 secondsLambda launched for quick event handlers
20155 minutesSmall batch and file jobs became possible
201815 minutesThe limit most architectures were built around, for eight years
September 202690 minutes (async and event source mappings on Lambda Managed Instances only)Longer runs for steady workloads on managed capacity
November 202630 minutes for every on-demand Event FunctionThe first change for everyone since 2018

Every Lambda duration limit, in one table

Event Functions (on demand)Event Functions (Lambda Managed Instances)Web FunctionsMicroVMs
Synchronous30 minutes30 minutes15 minutes8 hours (running and suspended)
Asynchronous30 minutes90 minutes——
Event source mapping30 minutes90 minutes——
Async with durable execution (whole workflow)Up to 1 yearUp to 1 year——
Maximum setting1,800 seconds1,800 s sync; 5,400 s async and mappings——

A value above the maximum is rejected with a validation error. On Lambda Managed Instances, synchronous calls are cut at 30 minutes even if the function’s timeout is set higher, and GetFunctionConfiguration still reports the configured value.

What didn’t change

  • Init phase: still 10 seconds for on-demand functions and 15 minutes on Lambda Managed Instances; provisioned concurrency and SnapStart keep their 15-minute initialization limit (see cold starts explained).
  • Memory, payload and storage limits: unchanged. A longer run doesn’t give you more memory (out-of-memory sizing) or a bigger response (the 6 MB payload limit).
  • Same function, same setup: runtime, handler, IAM role and VPC settings work exactly as before.
  • Monitoring: CloudWatch metrics, CloudTrail and X-Ray capture the full invocation as before.

How to set a 30-minute timeout

AWS CLI

💻 Where to run these commands

Easiest: AWS CloudShell, nothing to install. Sign in to the AWS Management Console, choose your Region at the top right, then click the CloudShell icon (a small >_ terminal symbol) in the top bar, or type CloudShell in the search box and open it. When the $ prompt appears, paste a command and press Enter. CloudShell already has the AWS CLI, uses your console permissions and costs nothing extra.

On your own computer: install AWS CLI version 2 (installers for Windows, macOS and Linux are on the AWS CLI page), run aws configure once (or aws configure sso if your company signs in through single sign-on), and check it works with aws sts get-caller-identity. Then paste commands into Terminal on Mac or Linux, or PowerShell or Command Prompt on Windows.

Windows tip: a line ending in a backslash ( \ ) continues on the next line in CloudShell, Mac and Linux. In PowerShell use a backtick ( ` ) instead, in Command Prompt a caret ( ^ ), or simply join the lines into one. JSON inside single quotes works as shown in CloudShell; on Windows, save the JSON in a file and pass it as file://name.json.

Python examples: save the code in a file such as script.py, install the AWS SDK with pip install boto3, and run python script.py (python3 on Mac and Linux). It uses the same credentials as the AWS CLI; CloudShell has Python and boto3 ready.

Replace example values such as my-bucket, my-function, 111122223333 (an account ID) and us-east-1 with your own.

aws lambda update-function-configuration \
  --function-name my-function \
  --timeout 1800

# check it
aws lambda get-function-configuration --function-name my-function --query Timeout

AWS SAM or CloudFormation

MyFunction:
  Type: AWS::Serverless::Function
  Properties:
    Runtime: python3.14
    Handler: app.handler
    Timeout: 1800
    MemorySize: 2048

In plain CloudFormation, the AWS::Lambda::Function resource takes the same Timeout property. Infrastructure tools that validate the value themselves need a recent version; the Serverless Framework, for example, added 30-minute timeouts in v4.47.

Console

Open the function, then Configuration → General configuration → Edit, and set the timeout to up to 30 minutes. Synchronous test invocations in the console now run for up to 30 minutes too.

When it takes effect

The new timeout applies to invocations that start after the update. For event source mappings, allow a few minutes for the change to reach the poller. Runs already in progress keep the old limit.

Jake: "That’s the easy bit, right?"

Ethan: "The one-line bit. The rest of the afternoon is everything that sits in front of and behind the function."

Not covered: Lambda@Edge

Functions that run at CloudFront locations through Lambda@Edge keep their own, much shorter limits: 5 seconds for viewer events and 30 seconds for origin events. The 30-minute change is for regular Event Functions in AWS Regions.

Callers that give up before your function does

When something invokes Lambda synchronously, it waits with its own timer. If that timer is shorter, the caller fails, but your function keeps running to the end, and you pay for every second.

CallerHow long it waitsWhat to do
API Gateway REST API29 seconds by defaultReturn 202 quickly and do the work asynchronously (endpoint request timed out)
API Gateway HTTP API30 seconds at mostSame job pattern
Lambda function URLUntil the function returnsWorks for up to 30 minutes, but the client must wait that long
Step Functions StandardUntil the function returnsThe new timeout applies; set the task timeout to match
AWS SDK clientsTheir own read timeout (60 seconds by default in boto3), with automatic retriesRaise the read timeout above 30 minutes and turn off retries for long calls

The SDK retry trap

This one surprises people. SDK clients retry automatically when a read times out. So a script that calls a 20-minute function synchronously with default settings can give up after a minute, call the function again, and again, starting several parallel runs, and still end with an error. If you really need to wait for a long synchronous call, configure the client on purpose:

# Python (boto3): wait up to 31 minutes, no automatic retries
import boto3
from botocore.config import Config
cfg = Config(read_timeout=31 * 60, connect_timeout=10, retries={"total_max_attempts": 1})
lam = boto3.client("lambda", config=cfg)
resp = lam.invoke(FunctionName="my-function", Payload=b"{}")

# AWS CLI: longer read timeout for this call
aws lambda invoke --function-name my-function --cli-read-timeout 1900 out.json

Also turn on TCP keep-alive on long-waiting clients, so idle network devices in between don’t drop the connection.

The job pattern for anything behind an API

  1. The API receives the request and immediately puts a job on a queue (or invokes a function asynchronously), returning 202 Accepted with a job ID.
  2. A worker function picks up the job and can now use the full 30 minutes.
  3. The worker writes progress and the result to a database or S3.
  4. The client polls a status endpoint, or gets a callback or WebSocket message, when the job is done.

This was the right design before November and still is; the only difference is that the worker has twice as long to finish.

Step Functions and the 30-minute timeout

The new timeout also applies when Step Functions Standard workflows invoke your function. Give the Task state a matching TimeoutSeconds so the workflow doesn’t give up first, and add a Retry block only for errors that are worth repeating:

"RunReport": {
  "Type": "Task",
  "Resource": "arn:aws:states:::lambda:invoke",
  "Parameters": { "FunctionName": "report-builder", "Payload.$": "$" },
  "TimeoutSeconds": 1800,
  "Retry": [{ "ErrorEquals": ["Lambda.TooManyRequestsException"], "MaxAttempts": 3, "BackoffRate": 2 }],
  "End": true
}

Express workflows are different: an Express workflow can only run for 5 minutes in total, so it can never wait for a long Lambda function. Long tasks belong in Standard workflows, or in an asynchronous call that Express hands off and doesn’t wait for.

Queues and streams: what to change

SQS: raise the visibility timeout first

For an SQS trigger, set the queue’s visibility timeout to at least six times the function timeout: 3 hours (10,800 seconds) for a 30-minute function, so Lambda has room to retry if it’s throttled. Lambda checks this when you create the event source mapping, but not when you later change the queue or the function, so on an existing setup the order matters: raise the visibility timeout, then the function timeout.

aws sqs set-queue-attributes --queue-url https://sqs.us-east-1.amazonaws.com/111122223333/jobs \
  --attributes VisibilityTimeout=10800
aws lambda update-function-configuration --function-name job-worker --timeout 1800

The side effect: a message from a run that crashed stays invisible for up to 3 hours before it’s retried. If that’s too slow, keep the function timeout lower than 30 minutes, or report failures explicitly. Messages that keep failing should end up in a dead-letter queue.

Kinesis and DynamoDB Streams

Lambda processes one batch per shard at a time by default, so longer invocations slow down how fast each shard is read. Watch the IteratorAge metric, raise the parallelization factor if records back up, and turn on partial batch failure reporting so a failure late in a long batch retries only the failed records, not the whole batch.

Still 14 minutes

  • Amazon MQ (ActiveMQ and RabbitMQ) event source mappings.
  • Amazon DocumentDB event source mappings.
  • Kafka (Amazon MSK or self-managed) mappings created before November 19, 2026 that don’t use provisioned mode. Create a new mapping, or turn on provisioned mode, to get 30 minutes.
  • For these, keep the function timeout at 840 seconds or less.

Asynchronous calls: retries multiply time and cost

Asynchronous invocations (from S3 events, SNS, EventBridge and others) are retried twice by default when they fail or time out. With a 30-minute timeout, a job that hangs runs three times, 90 minutes in total, before the event reaches your dead-letter queue or on-failure destination, and you pay for all three runs. Decide deliberately:

# no automatic retries, and drop events older than 2 hours
aws lambda put-function-event-invoke-config --function-name my-function \
  --maximum-retry-attempts 0 --maximum-event-age-in-seconds 7200

Keep retries for jobs that fail for temporary reasons and are safe to repeat; turn them off for long jobs where a timeout usually means a real problem.

What a 30-minute function costs

Lambda bills per request ($0.20 per million) and per GB-second of duration ($0.0000166667 on x86, $0.0000133334 on Arm, US East, first pricing tier). For a full-length run:

MemoryGB-seconds per 30-minute runx86 per runArm per run1,000 runs a day for 30 days (x86)
512 MB900$0.015$0.012$450
2,048 MB3,600$0.060$0.048$1,800
4,096 MB7,200$0.120$0.096$3,600
10,240 MB18,000$0.300$0.240$9,000

Two things to notice. First, Lambda charges for duration, so one 30-minute run costs the same as two chained 15-minute runs; the saving from merging functions is in simplicity, fewer requests and fewer orchestration steps, not in compute. Second, at steady volume, long-running functions can cost more than containers or Lambda Managed Instances, where you pay for instances (and can use Savings Plans). Our Graviton5 guide covers the instance side.

Concurrency doubles too

Concurrency = requests per second × average duration in seconds. One request per second at 30 minutes each needs 1,800 concurrent executions, more than the usual default of 1,000 concurrent executions per Region (new accounts can start lower). Check your quota and any reserved concurrency before raising timeouts on busy functions (Lambda 429 errors and concurrency math).

Long runs and the network: connections, DNS and credentials

  • NAT gateways drop idle connections after 350 seconds. A function in a VPC that waits quietly on a slow API through a NAT gateway (Lambda VPC and NAT) needs TCP keep-alive packets, or the connection silently dies.
  • Database and cache idle timeouts: make sure RDS, ElastiCache and external APIs allow connections to stay open for the whole run; RDS Proxy helps with connection churn.
  • DNS caching: some runtimes cache DNS for a long time (the JVM can cache forever in some setups). Set a short TTL, such as 5 seconds for Java, so a 30-minute run follows endpoint changes.
  • Credentials and tokens: temporary credentials or API tokens fetched at the start may expire mid-run; check their lifetime or refresh them in the background.
  • Logs: long runs produce long log streams; if logs go missing, see Lambda not logging to CloudWatch.

30-minute timeout vs durable functions

They solve different problems and work together. The function timeout limits one invocation. Durable functions save checkpoints with step() and wait() so a workflow resumes from the last completed step after a failure, and an asynchronously started durable execution can last up to a year across many invocations.

JobBest fit
Idempotent work under 30 minutes, triggered by SQS (e.g. an ETL step)Just raise the timeout; a failed run goes back to the queue
A 25-minute job that’s expensive to repeat30-minute timeout plus durable checkpoints, so a failure at minute 22 resumes instead of restarting from zero
Hours of work, or waiting for approvalsDurable functions or Step Functions
Steady, long-running batchLambda Managed Instances (90-minute async) or containers on Fargate
Running untrusted code written by users or AI tools, per sessionLambda MicroVMs (up to 8 hours)

Durable steps run at least once by default: a step that fails before its checkpoint is saved can run again. Make side effects such as payments and database writes idempotent (Powertools for AWS Lambda has an idempotency utility), and see how to prevent duplicate processing.

A safety net in code: watch the clock

Even with 30 minutes, some jobs won’t always fit: a huge file, a slow day for an API. Instead of letting Lambda kill the run, check the time left and hand over cleanly. Every runtime’s context object reports the remaining milliseconds:

import json, boto3
sqs = boto3.client("sqs")
QUEUE = "https://sqs.us-east-1.amazonaws.com/111122223333/jobs"
SAFETY_MS = 60_000  # stop with one minute to spare

def handler(event, context):
    job = json.loads(event["Records"][0]["body"])
    start = job.get("next_item", 0)
    for i in range(start, job["total_items"]):
        if context.get_remaining_time_in_millis() < SAFETY_MS:
            # save progress and queue the rest as a new message
            job["next_item"] = i
            sqs.send_message(QueueUrl=QUEUE, MessageBody=json.dumps(job))
            return {"status": "continued", "next_item": i}
        process_item(job, i)
    return {"status": "done"}

In Node.js the same call is context.getRemainingTimeInMillis(). The continuation pattern makes jobs of any length safe on Lambda; durable functions do the same thing for you with checkpoints, which is the cleaner choice for new code. Either way, a run that ends on purpose is far easier to debug than one that ends with “Task timed out”.

Workarounds you can now remove (and the ones to keep)

Workaround built for the 15-minute limitCan you remove it?
Two or three chained functions passing state alongUsually yes, if the total reliably stays under about 25 minutes
A Step Functions loop that splits one job into 15-minute chunksOften yes; keep Step Functions if you also use it for retries, branching or visibility
Continuation messages to SQSKeep it as a safety net for jobs that can still exceed 30 minutes
A Fargate or ECS task just for the 15-30 minute jobsMaybe; compare cost at your volume first
AWS Batch for medium jobsKeep it for jobs that need more memory, GPUs or hours of runtime

The test for each one: does it still earn its keep for a reason other than the old limit? Retries, audit trails and parallel fan-out are good reasons; “Lambda used to stop at 15 minutes” isn’t any more.

Monitoring long functions

Errors alone won’t tell you a function is drifting toward its limit. Alarm on Duration instead, for example when the longest run in five minutes passes 90% of a 30-minute timeout (1,620,000 ms):

aws cloudwatch put-metric-alarm --alarm-name my-function-near-timeout \
  --namespace AWS/Lambda --metric-name Duration \
  --dimensions Name=FunctionName,Value=my-function \
  --statistic Maximum --period 300 --evaluation-periods 1 \
  --threshold 1620000 --comparison-operator GreaterThanThreshold \
  --alarm-actions arn:aws:sns:us-east-1:111122223333:ops-alerts
  • Timeouts show up in the logs as “Task timed out after 1800.00 seconds”; a metric filter on that text turns them into a count you can alarm on.
  • Throttles rise when longer runs eat into concurrency; alarm on the Throttles metric too.
  • For queues and streams, watch ApproximateAgeOfOldestMessage (SQS) and IteratorAge (Kinesis, DynamoDB Streams).
  • Cost: a budget alert on Lambda spend catches the “retries tripled the bill” surprise early.

Should you raise the timeout? A quick test

  1. Measure first: check the function’s real Duration in CloudWatch. If it already finishes in 2 minutes, raising the timeout only lets hung runs cost more.
  2. Ask why it’s slow: a function that hits 14 minutes often has a slow dependency, a missing index or no pagination. A bigger timeout hides the symptom.
  3. Check the caller: API Gateway and default SDK clients won’t wait 30 minutes.
  4. Check the trigger: SQS visibility, stream iterator age, the 14-minute source types.
  5. Set retries and alarms: know how long a failure takes to surface.
  6. Then raise it, to a value a little above the longest run you’ve measured, not straight to 1,800.

Test the long path before production does

  1. Use a test alias or a copy of the function with the new timeout, and feed it the largest real input you have, not a sample.
  2. Read the REPORT line at the end of each run in CloudWatch Logs: Duration, Billed Duration and Max Memory Used. A job that runs twice as long often needs more memory too.
  3. Force a failure on purpose: temporarily set a short timeout, run the job, and confirm the event reaches your dead-letter queue or on-failure destination, and that someone gets alerted.
  4. Test the queue path: for SQS triggers, kill a run halfway and watch how long the message takes to reappear; that’s your real recovery time.
  5. Test the caller: run the client that invokes the function with its production timeouts and retry settings, and check it starts exactly one run.
  6. Only then raise the timeout on the production alias.

Half an hour of testing here saves a 3 AM page later, when the first real 28-minute job meets a 60-second client.

Also new the same week: GPUs on Lambda

Lambda Event Functions can now run on GPU instances through Lambda Managed Instances, packaged as container (OCI) images, with no GPU drivers, CUDA versions or AMIs to manage. It’s aimed at inference with custom models, media processing, rendering and scientific computing on G-series instances from G4dn to G6e. In AWS’s walkthrough, four concurrent requests shared one copy of a model on a single GPU and finished in about the time of one. You pay the EC2 instance price (Savings Plans and Reserved Instances apply), a 9.75% management fee for GPU instances, and $0.20 per million requests (launch post).

What people are saying

  • “Hell froze over”: a well-known serverless voice greeted the change that way, adding they weren’t sure how they felt about it. The mixed feeling is common: longer timeouts remove workarounds, but also remove a useful forcing function.
  • “It should have been a container anyway”: the sharper take from a popular AWS commentary account. For steady, long batch work, that’s often still true; the cost table above shows why.
  • The 29-second wall: a hands-on write-up warned that the new limit “sounds great until your API Gateway times out at 29 seconds and keeps charging you”. Its author also found the SDK retry trap, where a default client starts parallel runs.
  • “Thirty minutes hides the symptom, not the cause”: the same author’s advice was to raise the timeout only for functions whose runtime you’ve measured.
  • The slow failure path: several engineers pointed out that an SQS-fed function now waits up to 3 hours to retry a crashed message, and an async function that times out three times runs 90 minutes before reaching its DLQ.
  • Glue code you can delete: others welcomed the chance to remove the Step Functions chains and split-and-continue tricks built to dodge the 15-minute limit. One developer ran a 30-million-season football simulation in a single function just to try it.
  • Tooling caught up fast: the Serverless Framework shipped support within days; check your own deployment tool if it rejects 1,800.

For platform teams

  • Guardrails: consider a policy or CI check that flags timeouts above, say, 15 minutes for review, so 1,800 isn’t the new default everywhere.
  • Quotas: review concurrency quotas for accounts with long-running functions.
  • Alarms: alert on Duration near the timeout and on throttles, not just on errors.
  • Templates: update shared modules so SQS visibility timeouts are derived from function timeouts (6x).
  • Cost reviews: long, steady functions are candidates for Lambda Managed Instances or containers.
  • Runbooks: update on-call notes; “Lambda can’t run more than 15 minutes” is now wrong, and a stuck function can hold a message or a concurrency slot twice as long as before.
  • Documentation: record why each function has the timeout it has, so the next person doesn’t raise everything to 1,800 to “be safe”.

Common mistakes

MistakeWhat happensDo this instead
Raising the timeout behind API GatewayUsers still get errors at 29-30 s; the function runs on and billsJob pattern with 202 and a status endpoint
Raising the function timeout before the SQS visibility timeoutMessages reappear mid-run and get processed twiceVisibility first (6x), then the function
Calling a long function with a default SDK clientRetries start parallel runsLong read timeout, retries off
Leaving async retries at 2 for long jobs90 minutes and 3x cost per failureSet retries and max event age deliberately
Setting 1,800 everywhereHung runs cost 30 minutes eachSet just above the measured longest run
Expecting it on an old Kafka mappingStill capped at 14 minutesRecreate the mapping or use provisioned mode

If a long function dies with “Runtime exited with signal: killed”, that’s memory, not time (the fix); if it says the process exited before completing, see that guide.

What Ethan and Jake did with the report

  1. They measured the three chained functions: 22 minutes in total, every night, at 2,048 MB.
  2. The report is started by an EventBridge schedule (asynchronous), so no API Gateway limit applies.
  3. They merged the code into one function with a 25-minute timeout, a little above the longest run.
  4. They set async retries to one and added an on-failure destination that emails Ethan.
  5. They added a durable checkpoint after the slowest step, so a failure late in the run doesn’t start from zero.
  6. Cost per night: 2 GB × 1,320 seconds = 2,640 GB-seconds, about $0.044, the same as before, but with two fewer functions to maintain.

Jake: "So I deleted two functions and it costs the same?"

For readers preparing for an AWS certification

We have been covering AWS certifications alongside our fixes, so here is a short extra for readers studying for one. If you only came for the fix, you already have it; feel free to skip this part.

Exams that test this topic: Developer – Associate (DVA-C03 from December 1, 2026) • Solutions Architect – Associate (SAA-C03) • CloudOps Engineer – Associate (SOA-C03).

Here are the exam-style questions this topic tends to raise, with the reasoning you need to answer them:

1. A Lambda function processes SQS messages and its timeout is raised to 30 minutes. What should the queue visibility timeout be at minimum?

At least six times the function timeout: 180 minutes (10,800 seconds), set before raising the function timeout.

2. A Lambda function behind an API Gateway REST API needs 10 minutes to finish. Users get errors after about 29 seconds. What is the recommended fix?

Return a 202 response immediately and process the work asynchronously (for example through SQS or an asynchronous Lambda invocation), with a status endpoint for the result.

3. An asynchronously invoked Lambda function with a 30-minute timeout keeps timing out. How long can one event take to reach the dead-letter queue with default settings?

About 90 minutes: the initial attempt plus two default retries, each up to 30 minutes. Lower MaximumRetryAttempts to fail faster.

4. A function with an average duration of 30 minutes receives 1 request per second. How much concurrency does it need?

About 1,800 concurrent executions (requests per second x duration in seconds), which exceeds the usual default quota of 1,000.

5. Which Lambda feature lets a multi-step job resume from its last checkpoint after a failure instead of restarting?

Lambda durable functions, which checkpoint progress with step() and wait() operations.

Exam codes and dates change often. Our AWS certification changes page keeps track of what is current.

Ethan: "Same money, less to break. That’s the real win here."

Official references

Frequently asked questions

What is the maximum AWS Lambda timeout?

30 minutes (1,800 seconds) for Event Functions running on demand, since November 19, 2026, for synchronous, asynchronous and event source mapping invocations. On Lambda Managed Instances, asynchronous and event source mapping invocations can run up to 90 minutes (5,400 seconds).

Is the Lambda 15-minute limit gone?

For Event Functions, yes: the limit doubled to 30 minutes. Web Functions still have a 15-minute limit, and Amazon MQ, DocumentDB and older non-provisioned Kafka event source mappings stay at 14 minutes.

How do I set a Lambda timeout of 30 minutes?

Run aws lambda update-function-configuration --function-name NAME --timeout 1800, set Timeout: 1800 in your SAM or CloudFormation template, or change it in the console under Configuration > General configuration.

Does the 30-minute timeout cost extra?

No. Standard Lambda pricing applies: you pay per request and per GB-second of duration. A 2,048 MB function running the full 30 minutes costs about $0.06 per run on x86 and $0.048 on Arm in US East.

Why does my Lambda still time out after 29 seconds?

Because the caller gave up, not Lambda. API Gateway REST APIs wait 29 seconds by default and HTTP APIs at most 30 seconds. Your function may keep running, and billing, after the client gets the error. Use an asynchronous job pattern instead.

What SQS visibility timeout do I need for a 30-minute Lambda?

At least six times the function timeout, so 3 hours (10,800 seconds). Raise the queue’s visibility timeout first, then the function timeout.

Does the 30-minute timeout work with Kafka event source mappings?

Only for mappings created on or after November 19, 2026, or ones using provisioned mode. Older non-provisioned Kafka mappings stay limited to 14 minutes until you recreate them or turn on provisioned mode.

Is the 30-minute timeout available in every Region?

For on-demand Event Functions, in all commercial AWS Regions. For synchronous invocations on Lambda Managed Instances, wherever Lambda Managed Instances is available.

What is the difference between the function timeout and durable functions?

The function timeout limits each single invocation (now up to 30 minutes). Durable functions save checkpoints so a whole workflow can run for up to a year across many invocations, resuming after failures instead of starting over.

Did the Lambda init timeout change?

No. Initialization is still limited to 10 seconds for on-demand functions and 15 minutes on Lambda Managed Instances; provisioned concurrency and SnapStart keep their 15-minute initialization limit.

How long can Lambda MicroVMs and Web Functions run?

MicroVMs up to 8 hours (running and suspended combined). Web Functions keep a 15-minute limit.

Should I move long jobs from Fargate back to Lambda?

Only if they reliably finish well under 30 minutes and have spiky traffic. Jobs that run longer, need more than Lambda’s memory, or run steadily are usually still better on containers or Lambda Managed Instances.

How do I make a Lambda function stop safely before it times out?

Check context.get_remaining_time_in_millis() (Python) or context.getRemainingTimeInMillis() (Node.js) as you work, and when little time is left, save progress and queue the rest, or use durable functions, which checkpoint for you.

Does Step Functions Express support a 30-minute Lambda task?

No. An Express workflow can run for at most 5 minutes in total. Use a Standard workflow, with the Task state’s TimeoutSeconds set to 1800, for long Lambda tasks.

Does the 30-minute timeout apply to Lambda@Edge?

No. Lambda@Edge keeps its own limits of 5 seconds for viewer events and 30 seconds for origin events.

Can Lambda use GPUs now?

Yes, on Lambda Managed Instances: Event Functions packaged as container images can run on G-series GPU instances from G4dn to G6e, billed at the EC2 instance price plus a 9.75% management fee and $0.20 per million requests.

Revision note. Written December 3, 2026, two weeks after the 30-minute timeout launched on November 19. Prices are US East rates from that day. “More haste, less speed”: measure how long a function really runs before you give it more time.

Related