使用无服务器框架设置API网关集成请求超时

时间:2019-11-17 19:10:44

标签: aws-lambda aws-api-gateway serverless-framework

是否可以在serverless.yml配置中的AWS API Gateway中设置自定义请求集成超时?

尽管问题很简单,但我发现一些上下文总是有用的:

当lambda函数超时时,我需要通知最终用户。由于项目要求,可能会发生这种情况(lambda正在与可能未启动的第三方系统进行通信)。我想出了其他一些解决方案,但是我认为最好将API-GW请求超时设置为与lambda超时相同。

1 个答案:

答案 0 :(得分:0)

意识到使用recent update in serverless framework-函数超时在整个集成过程中都得到尊重。您要做的就是在函数中传递超时值。

这里是一个示例:

functions: myfunction: handler: public/index.php timeout: 15 #This will be same for integration timeout in API Gateway. tags: project: myproject