I’m trying to send mail using AWS SES from my Lambda function, but my function requires the VPC to be attached (for other functionality).
I have tried to add the Endpoint to the VPC, but this doesn’t see to help – my function times-out.
(I have two other (working) endpoints on the VPC, DynamoDB, and S3. I see the difference is there is an option for type=gateway, while the email Endpoint (com.amazonaws.eu-west-1.email-smtp) only has an option for Interface.)
Anyway, my next approach was to make a separate SendMail Lambda function that is not attached to the VPC, then from my main lambda function (that is attached to the VPC), i called the LambdaClient()
, and invoked my Lambda function… but this also doesn’t work! Somehow the SendMail (unattached) code gets somehow pull into the main Lambda function and is so unable to access the internet.
Does anyone know how to have the SendMail (unattached) Lambda Function execute using LambdaClient()
as a separate thread/place/server/etc so that it doesn’t inherit its caller configuration.
Other than this, i guess my next option would be to use something like fetch()
to re-call my own API again, but that seems like an extreme measure.