使用lambda函数URL超时错误持续时间更改AWS CloudFront分布

发布于 2025-02-09 14:11:17 字数 955 浏览 0 评论 0原文

我有一个CDK堆栈,该堆栈创建了几个lambdas,可以通过新的CloudFront功能URL来调用查询参数,并调用API通过CloudFront Distribution将数据发送回客户端。这是通过lambdas本身(不是云范围的功能或lambda edge)完成的,我在XRARE中注意到,默认情况下有三秒钟的超时。我不知道配置在哪里,但是我想知道是否有一种方法可以将持续时间增加到其他东西,因为我从另一个API中摘下图像。

当我查询API时,所有错误都会出现3秒钟的错误并失败,但是API呼叫会恢复成功。

这是CloudFront Distribution,(我发现功能URL只允许获取请求,但它比必须旋转整个API来处理这些函数更容易了电话) 分布的代码“

,如果您对lambda上的CloudFront Distributions创建函数URL感到好奇,这是我的代码:

有人知道如何配置功能调用时间限制,我有点困惑

I have a cdk stack that's creating a couple lambdas that take in query params and call api's to send data back to the client through a cloudfront distribution through the new cloudfront function urls. This is done through lambdas itself (not a cloudfront function or a lambda edge), and I've noticed through xray that there's a timeout at three seconds by default. I don't know where this is configured but I was wondering if there's a way to increase the duration to something else because I'm pulling images from another api.

All of the errors when I query the api and it takes 3 seconds error out and fail, but the api call comes back as successful.
the timeout errors I'm finding in xray

Here's the cloudfront distribution, (also I've found that function urls only allow get requests, but it made life a bit easier than having to spin up a whole api to handle these calls)
The cdk code for the distribution

And if you're curious on how to create function urls for cloudfront distributions on lambda, here is my code:
code to create a function url to connect to cloudfront

Does anyone know how to configure the function invocation time limit, I'm kinda stumped on this one

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

反目相谮 2025-02-16 14:11:17

如果您使用CDK配置lambda函数,则属性为'timeout',并且需要

If you're using CDK to configure your Lambda function then the attribute is 'timeout', and it takes a Duration.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文