AWS SES Not Working (

Hey All,

Currently facing an issue with setting up AWS Simple Email Service. It’s giving me the below error even though I don’t have an assumed-role of aws-lambda-execute. I have everything set up correctly on AWS SES with my verified identities so I’m unsure as to why it is showing an arn that is different from my smtp settings in my AWS profile.

The below log is attempting to send an email to ‘emajincomic@gmail.com’ (which works) and yet doesn’t work here on Netlify. Odd part is I did the same exact steps I did with a different netlify project where I have AWS SES working for emails, but it just doesn’t seem to be working here…

Any solution?

Oct 13, 11:37:06 PM: 3d37339e ERROR Error sending email AccessDenied: User arn:aws:sts::012004486566:assumed-role/aws-lambda-execute/7e014f0a687c79aa52808dadcc37ecd03698f9dcd7bb5f3b57301b0064dd2242' is not authorized to perform ses:SendEmail’ on resource arn:aws:ses:us-east-2:012004486566:identity/emajincomic@gmail.com'Oct 13, 11:37:06 PM: 3d37339e ERROR at Request.extractError (/var/task/node_modules/aws-sdk/lib/protocol/query.js:50:29)Oct 13, 11:37:06 PM: 3d37339e ERROR at Request.callListeners (/var/task/node_modules/aws-sdk/lib/sequential_executor.js:106:20)Oct 13, 11:37:06 PM: 3d37339e ERROR at Request.emit (/var/task/node_modules/aws-sdk/lib/sequential_executor.js:78:10)Oct 13, 11:37:06 PM: 3d37339e ERROR at Request.emit (/var/task/node_modules/aws-sdk/lib/request.js:686:14)Oct 13, 11:37:06 PM: 3d37339e ERROR at Request.transition (/var/task/node_modules/aws-sdk/lib/request.js:22:10)Oct 13, 11:37:06 PM: 3d37339e ERROR at AcceptorStateMachine.runTo (/var/task/node_modules/aws-sdk/lib/state_machine.js:14:12)Oct 13, 11:37:06 PM: 3d37339e ERROR at /var/task/node_modules/aws-sdk/lib/state_machine.js:26:10Oct 13, 11:37:06 PM: 3d37339e ERROR at Request.<anonymous> (/var/task/node_modules/aws-sdk/lib/request.js:38:9)Oct 13, 11:37:06 PM: 3d37339e ERROR at Request.<anonymous> (/var/task/node_modules/aws-sdk/lib/request.js:688:12)Oct 13, 11:37:06 PM: 3d37339e ERROR at Request.callListeners (/var/task/node_modules/aws-sdk/lib/sequential_executor.js:116:18) {Oct 13, 11:37:06 PM: 3d37339e ERROR code: 'AccessDenied',Oct 13, 11:37:06 PM: 3d37339e ERROR time: 2023-10-14T03:37:09.050Z,Oct 13, 11:37:06 PM: 3d37339e ERROR requestId: '3fe67232-5930-4a3d-a961-08409ce36eec',Oct 13, 11:37:06 PM: 3d37339e ERROR statusCode: 403,Oct 13, 11:37:06 PM: 3d37339e ERROR retryable: false,Oct 13, 11:37:06 PM: 3d37339e ERROR retryDelay: 7.882872443210998Oct 13, 11:37:06 PM: 3d37339e ERROR }Oct 13, 11:37:06 PM: 3d37339e ERROR Invoke Error {"errorType":"AccessDenied","errorMessage":"User arn:aws:sts::012004486566:assumed-role/aws-lambda-execute/7e014f0a687c79aa52808dadcc37ecd03698f9dcd7bb5f3b57301b0064dd2242’ is not authorized to perform ses:SendEmail' on resource arn:aws:ses:us-east-2:012004486566:identity/emajincomic@gmail.com’“,“code”:“AccessDenied”,“message”:“User arn:aws:sts::012004486566:assumed-role/aws-lambda-execute/7e014f0a687c79aa52808dadcc37ecd03698f9dcd7bb5f3b57301b0064dd2242' is not authorized to perform ses:SendEmail’ on resource arn:aws:ses:us-east-2:012004486566:identity/emajincomic@gmail.com'","time":"2023-10-14T03:37:09.050Z","requestId":"3fe67232-5930-4a3d-a961-08409ce36eec","statusCode":403,"retryable":false,"retryDelay":7.882872443210998,"stack":["AccessDenied: User arn:aws:sts::012004486566:assumed-role/aws-lambda-execute/7e014f0a687c79aa52808dadcc37ecd03698f9dcd7bb5f3b57301b0064dd2242’ is not authorized to perform ses:SendEmail' on resource arn:aws:ses:us-east-2:012004486566:identity/emajincomic@gmail.com’”,” at Request.extractError (/var/task/node_modules/aws-sdk/lib/protocol/query.js:50:29)“,” at Request.callListeners (/var/task/node_modules/aws-sdk/lib/sequential_executor.js:106:20)“,” at Request.emit (/var/task/node_modules/aws-sdk/lib/sequential_executor.js:78:10)“,” at Request.emit (/var/task/node_modules/aws-sdk/lib/request.js:686:14)“,” at Request.transition (/var/task/node_modules/aws-sdk/lib/request.js:22:10)“,” at AcceptorStateMachine.runTo (/var/task/node_modules/aws-sdk/lib/state_machine.js:14:12)“,” at /var/task/node_modules/aws-sdk/lib/state_machine.js:26:10"," at Request. (/var/task/node_modules/aws-sdk/lib/request.js:38:9)“,” at Request. (/var/task/node_modules/aws-sdk/lib/request.js:688:12)“,” at Request.callListeners (/var/task/node_modules/aws-sdk/lib/sequential_executor.js:116:18)"]}Oct 13, 11:37:09 PM: 3d37339e Duration: 1364.88 ms Memory Usage: 130 MB Init Duration: 724.46 ms

Found the solution.

I renamed my variable from:

‘SES_ACCESS_KEY’ to ‘SES_ACCESS’
‘SES_SECRET_KEY’ to ‘SES_SECRET’

Somehow now the permission error doesn’t happen and I’m able to use AWS SES :smiley: