【发布时间】:2021-11-04 22:36:46
【问题描述】:
当发出serverless deploy --region eu-central-1 时,我得到了错误
Type Error ---------------------------------------------
Cannot read property 'Properties' of undefined
For debugging logs, run again after setting the "SLS_DEBUG=*" environment variable.
此错误仅在包含后才开始
plugins:
- serverless-iam-roles-per-function
并且可以通过注释掉插件来恢复。但我想用它来让我的 lambda 访问 DynamoDB。
除了this typo 之外,互联网上关于这个错误的消息相当空白。错误不是 solved by a recent update (yet) 并且 serverless 的通知没有多大帮助。 set SLS_DEBUG=*" 部署前:
Type Error ----------------------------------------------
TypeError: Cannot read property 'Properties' of undefined
at ServerlessIamPerFunctionPlugin.createRoleForFunction (C:\Users\XXXXX\MyProject\node_modules\serverless-iam-roles-per-function\dist\lib\index.js:273:25)
at ServerlessIamPerFunctionPlugin.createRolesPerFunction (C:\Users\XXXXX\MyProject\node_modules\serverless-iam-roles-per-function\dist\lib\index.js:383:18)
at PluginManager.invoke (C:\snapshot\serverless\lib\classes\PluginManager.js:579:20)
at async PluginManager.spawn (C:\snapshot\serverless\lib\classes\PluginManager.js:601:5)
at async Object.before:deploy:deploy [as hook] (C:\snapshot\serverless\lib\plugins\deploy.js:60:11)
at async PluginManager.invoke (C:\snapshot\serverless\lib\classes\PluginManager.js:579:9)
at async PluginManager.run (C:\snapshot\serverless\lib\classes\PluginManager.js:639:7)
at async Serverless.run (C:\snapshot\serverless\lib\Serverless.js:452:5)
at async C:\snapshot\serverless\scripts\serverless.js:751:9
For debugging logs, run again after setting the "SLS_DEBUG=*" environment variable.
我应该在这篇文章中加入我的serverless.yml 吗?挺大的。
【问题讨论】:
标签: aws-lambda serverless-framework serverless aws-serverless