Search code examples
amazon-web-servicesamazon-s3amazon-iamamazon-ses

Authentication error while uploading file or sending email aws


By mistakenly I deleted all the IAM users from aws. And Now when I tried to upload the file into aws via node.js code, I am getting the error:

The AWS Access Key Id you provided does not exist in our records.

and when I trying to send the email from node.js code with ses credentials, I am getting the error:

Invalid login: 535 Authentication Credentials Invalid.

However, I created new access key and secret key pair to solve this problem, But still same issue. Can anyone please help with the same?


Solution

  • "535 Authentication Credentials Invalid" occurs when you use SMTP. It looks like you have created a IAM user from IAM console which access key and secret key won't work with SES with SMTP. You need to go to SES console and create a SMTP credentials from there (In SMTP settings), it basically also create an IAM user but the secret key is different for when accessing with SMTP. Doing this, it'll automatically give the appropriate permissions, you don't need to define the policy and stuff.