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

后端 未结 15 454
独厮守ぢ
独厮守ぢ 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:43

    After you update your policy, it seems that you have to update your function's settings to refresh all job instances to read new policies.

    So if you just click 'test' button from Lambda console after you update your role policy in IAM, the cached Lambda instances will still have old role permissions, so you will still see no logs being written to Cloudwatch logs.

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

提交回复
热议问题