我正在尝试将cloudwatchLog事件添加到我的lambda函数中,并且遇到意外错误。该错误消息不是很描述。有人知道发生了什么吗?
配置:
functions:
helloWorld:
handler: dist/handlers/index.helloWorld
events:
- cloudwatchLog:
logGroup: '/aws/lambda/serverless-test-package-4-dev-supWorld'
错误消息:
Serverless Error ---------------------------------------
An error occurred: HelloWorldLogsSubscriptionFilterCloudWatchLog1 -
Resource limit exceeded. (Service: AWSLogs; Status Code: 400; Error
Code: LimitExceededException; Request ID: e30b438c-a654-11e8-837a-7f86cfddec76).
Get Support --------------------------------------------
Docs: docs.serverless.com
Bugs: github.com/serverless/serverless/issues
Forums: forum.serverless.com
Chat: gitter.im/serverless/serverless
Your Environment Information -----------------------------
OS: linux
Node Version: 8.11.3
Serverless Version: 1.26.1
答案 0 :(得分:4)
问题在于,已经有一个Lambda订阅了CloudWatchLog事件。根据{{3}}的规定,AWS将每个CloudWatch Log Group限制为最多一个订阅。
答案 1 :(得分:1)
要解决此问题,您必须从日志组中删除已附加的订阅。只需从lambda中删除cloudwatchLog
事件并进行部署,就会从日志组中删除预订。然后,您可以为所需的日志组添加cloudwatchLog
事件,然后再次部署它。