skip to Main Content

I have already set up the necessary VPC endpoints as stated here.

However, when inside of my Lambda function (using Node.js) I do:

const sesClient = new SESClient({ });
...
await sesClient.send(sendEmailCommand);

it times out after 5 minutes.

Should a specific endpoint be specified when initializing the SES Client?

2

Answers


  1. Chosen as BEST ANSWER

    As Allan Chua suggested, using the SES SMTP interface with a tool like nodemailer works.

    nodemailer.createTransport({
      port: 587,
      host: `email-smtp.${region}.amazonaws.com`,
      auth: {
        user: smtpUsername,
        pass: smtpPassword
      }
    });
    

  2. Please check the corresponding SES API logs from CloudTrail to make sure that the SES API calls are going through your VPC endpoint properly. I have a strong hunch that the SDK is connecting to the API and VPC endpoints for SES are meant for SMTP. To solve your problem, please use SMTP interface or introduce a NAT Gateway to your VPC if your use-case allows it.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search