我通过sam init创建了一个新项目,并选择了以下选项:
1 - AWS Quick Start Templates
1 - nodejs14.x
8 - Quick Start: Web Backend然后从项目根目录内部运行sam local invoke -e ./events/event-get-all-items.json getAllItemsFunction,它返回:
Invoking src/handlers/get-all-items.getAllItemsHandler (nodejs14.x)
Skip pulling image and use local one: public.ecr.aws/sam/emulation-nodejs14.x:rapid-1.32.0.
Mounting /home/rob/code/sam-app-2/.aws-sam/build/getAllItemsFunction as /var/task:ro,delegated inside runtime container
Function 'getAllItemsFunction' timed out after 100 seconds
No response from invoke container for getAllItemsFunction你知道这是怎么回事吗?或者怎么调试它?谢谢。
发布于 2021-10-31 17:59:25
image/lambda会在某个地方调用数据库吗?运行lambda的容器是否具有正确的连接字符串和/或访问权限?在我看来,你的函数正在被调用,然后函数试图到达它无法到达的地方。
至于调试--使用大量的console.log()语句来缩小代码在遇到麻烦之前运行的范围。
https://stackoverflow.com/questions/69787738
复制相似问题