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
As other answers state you need to give lambda permission to post logs to cloud watch logs. AWS had provided AWSLambdaExecute
policy just for that. It's json is -
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"logs:*"
],
"Resource": "arn:aws:logs:*:*:*"
},
{
"Effect": "Allow",
"Action": [
"s3:GetObject",
"s3:PutObject"
],
"Resource": "arn:aws:s3:::*"
}
]
}
You can add this policy in your role which is assigned to your lambda and you should start seeing the logs.
NOTE: It also has S3 read/write access. If you do not want it you can create a custom policy with just the logs part.