Skip to content

Is sending email using SES supported for a Lamda deployed within a VPC?

0

I have created a lambda function nodejs that reads from sqs queue, then calls my ses service to send an email.

  1. The lambda is deployed within my VPC.

  2. I created a VPC Endpoint with security groups to allow traffic per the following:

https://docs.aws.amazon.com/ses/latest/dg/send-email-set-up-vpc-endpoints.html

  1. My lambda has sample code that aligns with the sendEmail example in the following:

https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/javascript_ses_code_examples.html

  1. Tried a number of different options, but still getting ETIMEDOUT errors.

Is SES for sending email supported in a lambda deployed to a VPC? Any guidance on troubleshooting networking issues?

1 Answer
0

SES integration with Lambda within a VPC is supported. Can you check to see:

  1. If the VPC Endpoint for SES is correctly configured and the security groups/route tables allow outbound access.
  2. If the Lambda function's VPC subnet and security group settings allow outbound access to the SES VPC Endpoint.
  3. Validate the IAM permissions for the Lambda function to access SES.
  4. Try testing the SES API connectivity from within the VPC, such as from an EC2 instance, to isolate if it's a VPC networking issue or an issue with the Lambda function itself.
  5. If none of the above works, and you still have timeouts, try changing the Lambda function's timeout or increasing it's memory allocation to give it enough resources to complete the SES API call.
  6. You can open up an AWS support case, if you are still having challenges https://docs.aws.amazon.com/awssupport/latest/user/getting-started.html
AWS

answered 2 years ago

EXPERT

reviewed 2 years ago

    • I also see that you are reading from SQS queue. All the above recommendations holds true for the SQS as well. IAM permissions (lambda has necessary IAM role or IAM permissions), security groups(VPC endpoint - lambda & SQS) etc.
    • Use a longer visibility timeout on the SQS queue to give the Lambda function more time to process messages.

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.