r/aws • • 5d ago

technical resource Lambda event functions are getting 30 minute timeouts

https://raw.githubusercontent.com/aws/aws-sdk-js-v3/refs/heads/main/CHANGELOG.md

From today's changelog:

client-lambda: Increase function timeout limit to 30 minutes for Lambda Event Functions.

There's also some other neat features coming out, like eventbridge webhook event sources, and STS GetScopedCredentials

91 Upvotes

16 comments sorted by

47

u/DoxxThis1 5d ago edited 3d ago

I knew it was a slippery slope the moment they increased it from the original 30 60 seconds. What’s next, 2 hours? /s

18

u/KhaosPT 5d ago

Yes please, I rather not have to deal with far gate and ecs if I need 1 hour batch jobs

17

u/burlyginger 5d ago

Fargate is beautifully simple. 

10

u/ziroux 5d ago

But it's far!

1

u/balbinator 2d ago

Too complex to just execute simple stuff

2

u/Johtto 3d ago

Original was 60s

5

u/baever 5d ago

Here's the formatted changelog and the info for GetScopedCredentials.

GetScopedCredentials looks like a great way to further scope down your Lambda execution role to just what the request needs. I.e. a dynamodb leading key based on tenant or an s3 prefix etc.

9

u/mequelkramer 5d ago

Good news for event driven work that kept bumping into the timeout limit, but I would treat the extra headroom as a safety net, not a default design for long jobs. A 30 minute run still bills for the full duration at your configured memory, so check the cost per invocation before moving batch style work here, and keep the handler idempotent with a dead letter queue, because a failure or timeout partway through a long run can leave partial work behind. For multi step work, long running jobs, or anything that needs clear state and retries, Step Functions with Fargate or ECS is still usually cleaner. The EventBridge webhook source is worth a look too, since it can remove a proxy layer for inbound events.

4

u/maigpy 5d ago

there no async concurrency unlike gcp if I'm not mistaken? it makes it very inefficient?

4

u/dusanodalovic 4d ago

if you feed it from sqs, check the queue visibility timeout first. aws says to set it to at least 6x the function timeout, so 30 min on the function means 3 hours on the queue. a run that hangs now delays its own retry by hours, not minutes. i'd put an alarm on message age before raising the timeout.

2

u/NoDevelopment206 4d ago

30 min is nice for stuff like big file processing that used to get chopped up into pieces. but i would still keep batch jobs that can fail halfway on fargate, since a retry on lambda reruns the whole thing and you pay for it again. the limit going up doesnt really change that

2

u/Neither_Bookkeeper92 4d ago

if you're bumping the timeout on functions that sit behind an alias, publish a new version and shift to it with a CodeDeploy canary plus an alarm on errors and duration. versions snapshot the config, so a bad timeout change rolls back on its own

0

u/Hostman_com 4d ago

For those hour-long batch jobs, async invocations on Lambda Managed Instances already support up to 90 minutes. The new 30-minute limit covers on-demand Event Functions and synchronous invocations on Managed Instances.

Before moving a job, test a failure after it has written some results, then retry the same input. Check that it can resume or safely repeat the work without creating duplicates.