aws-lambda-ses-forwarder
aws-lambda-ses-forwarder copied to clipboard
Lambda can't copy emails from S3
I have tried to follow all the instructions, but I am stumped by this problem. In the cloudwatch logs, the following is present:
level: 'info', message: 'Fetching email at s3://XXXXXXX.email/h9s9llkqemr9i9s38n61i5lo8iiuavkdcf35cq01'
I have verified that this file is indeed present in the S3 bucket.
However, the next log is:
level: 'error', message: 'copyObject() returned error:', error: AccessDenied: Access Denied at Request.extractError (/var/runtime/node_modules/aws-sdk/lib/services/s3.js
I have checked the role which runs the lambda in AIM management console and I have given it full S3 access for now (AmazonS3FullAccess)
So I can't work out why this access denied error is occuring.
Any help would be appreciated.
I had a similar issue and it turned out to be the emailKeyPrefix which in my case should have been set to an empty string, not a slash.