超过AWSLogs资源限制-无服务器`cloudwatchLog`事件

时间:2018-08-22 21:56:45

标签: amazon-web-services aws-lambda serverless-framework

我正在尝试将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

2 个答案:

答案 0 :(得分:4)

问题在于,已经有一个Lambda订阅了CloudWatchLog事件。根据{{​​3}}的规定,AWS将每个CloudWatch Log Group限制为最多一个订阅。

答案 1 :(得分:1)

要解决此问题,您必须从日志组中删除已附加的订阅。只需从lambda中删除cloudwatchLog事件并进行部署,就会从日志组中删除预订。然后,您可以为所需的日志组添加cloudwatchLog事件,然后再次部署它。