The full answer
You can raise a function's timeout up to Lambda's hard limit of 15 minutes (900 seconds); beyond that, split the work, or run it somewhere without the limit.
1. Raise the timeout (up to 15 minutes)
- Console: Configuration → General configuration → Timeout.
- CLI:
aws lambda update-function-configuration --function-name my-fn --timeout 900 - Infrastructure as code:
timeout = 900in Terraform,Timeout: 900in CloudFormation or SAM.
Note that the caller may give up earlier: API Gateway's integration timeout is much shorter than 15 minutes by default, so long work behind an API should be started asynchronously and its result fetched later.
2. Make it faster
- More memory also gives proportionally more CPU, so a CPU-bound function often finishes faster, and sometimes costs less, with more memory.
- Reuse connections and clients across invocations by creating them outside the handler.
- Process records in parallel within the function where the work allows it.
3. Split long work into steps
- AWS Step Functions chains several Lambda invocations (and other services) with retries, branching and a Map state that fans out over thousands of items. A Standard workflow can run for up to a year.
- Lambda durable functions checkpoint progress, pause and resume, so a single workflow written as code can run far longer than 15 minutes while each invocation stays within the limit.
- Queues: put work items in SQS and let many short invocations process them in parallel.
4. Use a service without the limit
- AWS Fargate (ECS or EKS) for long-running containers without servers.
- AWS Batch for batch jobs of any length.
- AWS Glue or EMR Serverless for data processing jobs.
- EC2 when you need full control.
How to answer in an interview: state the 15-minute limit plainly, show how to set the timeout, then explain that a job approaching the limit is a design signal. Breaking it into idempotent steps with Step Functions or a queue usually makes it more reliable as well, because a failure retries one step instead of the whole job.
Last updated 16 October 2026
Sources