2
votes

I am using serverless and AWS-Lambda. So I need a method where the name of the cloudwatch logs can be managed from the serverless.yml.

this is the yml for the function:

updatePermission:
 handler: permissionupdate.handler
 events:
  - cloudwatchLog: 'updatePermission'
  - http:
      path: /
      method: put
      cors: true
      integration: lambda
      request:
        parameters:
          querystrings:
            companyId: true
            userId: true

No cloudwatch log name has formed with this title.

1
Let me get this straight: you want the ability to name the cloudwatch logs event stream in serverless framework? Because that is how I understand your question. On the other hand your code suggests you are trying to write a lambda that reacts to logs being generated by itself. Both of these are weird. What are you trying to do? - Adam Owczarczyk
I want the ability to rename cloudwatch logs for each function through serverless yml . - suku

1 Answers

4
votes

AWS docs doesn't mention any way you could name your cloudwatch logs stream for lambda, they are always named /aws/lambda/<function name> so that might be the reason why there is no such option in Serverless. What your yaml does is hook to an event published to updatePermission log stream, which is a different thing entirely.