amazon web services - AWS Lambda + S3 + SES+ Gmail Forwarding : 'copyObject() returned error:' -
i have followed you've spelt out on https://github.com/arithmetric/aws-lambda-ses-forwarder stuck. no amount of google search or no playing options either has helped. client terminate contract - we've stuck @ error long.
i have verified domain. can receive email anywhere through verified address designated s3 bucket. changed '"functionarn":xxx..."' '"functionarn": "arn:aws:lambda:us-west-2:my-account-id:function:fnforwardemailtogmail"'.
however received emails never forwarded , when test function using "ses email receiving" error below.
start requestid: 7f2cd5ed-83ea-11e7-913f-55748388c69f version: $latest 2017-08-18t07:54:44.467z 7f2cd5ed-83ea-11e7-913f-55748388c69f { level: 'info', message: 'fetching email @ s3://my-s3-bucket/my-prefix/o3vrnil0e2ic28fgfdstrm7dfhrc2v0clambda4nbp0g1' } 2017-08-18t07:54:46.068z 7f2cd5ed-83ea-11e7-913f-55748388c69f { level: 'error', message: 'copyobject() returned error:', error: { [accessdenied: access denied] message: 'access denied', code: 'accessdenied', region: null, time: fri aug 18 2017 07:54:46 gmt+0000 (utc), requestid: 'a6285517d1af2b9d', extendedrequestid: 'dfh3css5khlsyn4zgiwvliymuvb1ogcvl6kdusdzdqwx2t+jdkfzwiypa5kegyfijfzmrwxjxdi=', cfid: undefined, statuscode: 403, retryable: false, retrydelay: 32.49475641641766 }, stack: 'accessdenied: access denied @ request.extracterror (/var/task/node_modules/aws-sdk/lib/services/s3.js:473:35) @ request.calllisteners (/var/task/node_modules/aws-sdk/lib/sequential_executor.js:105:20) @ request.emit (/var/task/node_modules/aws-sdk/lib/sequential_executor.js:77:10) @ request.emit (/var/task/node_modules/aws-sdk/lib/request.js:615:14) @ request.transition (/var/task/node_modules/aws-sdk/lib/request.js:22:10) @ acceptorstatemachine.runto (/var/task/node_modules/aws-sdk/lib/state_machine.js:14:12) @ /var/task/node_modules/aws-sdk/lib/state_machine.js:26:10 @ request.<anonymous> (/var/task/node_modules/aws-sdk/lib/request.js:38:9) @ request.<anonymous> (/var/task/node_modules/aws-sdk/lib/request.js:617:12) @ request.calllisteners (/var/task/node_modules/aws-sdk/lib/sequential_executor.js:115:18)' } 2017-08-18t07:54:46.127z 7f2cd5ed-83ea-11e7-913f-55748388c69f {"errormessage":"error: not make readable copy of email."} end requestid: 7f2cd5ed-83ea-11e7-913f-55748388c69f report requestid: 7f2cd5ed-83ea-11e7-913f-55748388c69f duration: 1993.85 ms billed duration: 2000 ms memory size: 128 mb max memory used: 32 mb
lambda role function policy
{ "version": "2016-03-04", "statement": [ { "effect": "allow", "action": [ "logs:createloggroup", "logs:createlogstream", "logs:putlogevents" ], "resource": "arn:aws:logs:*:*:*" }, { "effect": "allow", "action": "ses:sendrawemail", "resource": "*" }, { "effect": "allow", "action": [ "s3:getobject", "s3:putobject" ], "resource": "arn:aws:s3:::my-s3-bucket/*" } ] }
i have added lambda role 2 managed roles "amazons3fullaccess" , "amazonsesfullaccess".
s3 bucket policy
{ "version": "2012-10-17", "statement": [ { "sid": "givesespermissiontowriteemail", "effect": "allow", "principal": { "service": "ses.amazonaws.com" }, "action": "s3:putobject", "resource": "arn:aws:s3:::my-s3-bucket/*", "condition": { "stringequals": { "aws:referer": "my-account-id" } } } ] }
where going wrong? pls help!
that copyobject()
call seems copying files in s3. should add s3 permissions role.
Way cool! Some very valid points! I appreciate you writing this article and also the rest of the website is extremely good.
ReplyDeleteaws online training
r programming online training