Can't get AWS Lambda function to log (text output) to CloudWatch

后端 未结 15 552
独厮守ぢ
独厮守ぢ 2020-12-13 12:14

I\'m trying to set up a Lambda function that will process a file when it\'s uploaded to an S3 bucket. I need a way to see the output of console.log when I uploa

15条回答
  •  长情又很酷
    2020-12-13 12:36

    For the lambda function to create log stream and publish logs to cloudwatch, the lambda execution role needs to have the following permissions

    I already had these permissions yet it did not work.

    Just change your timeout by a second and click on 'save and test' button, and you will start to see logs in Cloudwatch.

    I changed the timeout, saved and logs still did not work.

    I assigned another role and logs still did not work.

    What ended up working for me was clicking "Create a custom role", then "Allow". This was it and logs started being generated but since I did not want to use a new role but my existing role, I simply assigned my existing role afterwards and it worked. So technically I should have returned back to original configuration that did not work but now it works. Go figure.

提交回复
热议问题