Here is my humble NodeJS function that times out after 5 minutes. CloudWatch Logs don't give me any details on what happened, just the it timed out.
const AWS = require('aws-sdk');
const util = require('util');
const simpleParser = require('mailparser').simpleParser;
const s3 = new AWS.S3();
exports.handler = async (event, context, callback) => {
const srcBucket = event.Records[0].s3.bucket.name;
const srcKey = decodeURIComponent(event.Records[0].s3.object.key.replace(/\+/g, " "));
const params = {
Bucket: srcBucket,
Key: srcKey
};
console.log(params)
var data = await s3.getObject(params).promise();
console.log(data)
};
Execution Env Node 12, 5 min timeout. I have verified the correct s3 trigger input and that the code works on my local nodeJS environment.
In execution role, I have added pretty much everything but the kitchen sink - AmazonRDSFullAccess AmazonS3FullAccess CloudWatchLogsFullAccess AmazonRDSDataFullAccess AmazonVPCFullAccess AWSLambdaExecute AWSLambdaVPCAccessExecutionRole AWS managed policy
any help is greatly appreciated, losing my mind at this point.