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
As Allan Chua suggested, using the SES SMTP interface with a tool like nodemailer works.
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.