Main Page
 The gatekeeper of reality is
 quantified imagination.

Stay notified when site changes by adding your email address:

Your Email:

Bookmark and Share
Email Notification
Project Node.js Lambda & SES
Purpose
The purpose of this project is to show how to get your AWS Lambda Node.js code to send email via SES. Like most things with Lambda and AWS it is not necessarily complex, it's just that there are several steps that are required. And, as you will see, due to the "sandbox" for SES if you are conducting testing some oddities can lead to a bit of confusion.


(Enlarge)
  1. The first thing that you will need to do is to go into SES and add (and validate) two email addresses. One will serve as the "from" address and the other will be the "to" address (whom you want to send the email address to).

(Enlarge)
  1. Once you have entered and validated the two email addresses you will need to get the "identity arn" number. Under Email Addresses of the SES, in this example we get the arn for the "from" address.

(Enlarge)
  1. You will also need to create an IAM user that will be used to deal with email messages. In the IAM area, create the user and be sure to record the secret key and the access key (as both will be required for the Lambda Node.js code).

(Enlarge)
  1. Under the IAM section you will also need to create a policy for sending email messages. If you are still in the SES "sandbox" (or restricted mode) both your "from" and "to" email addresses have to be specified in the policy document even though you've separately validated both of them. Odd, huh?

(Enlarge)
  1. Under the IAM section you should already have at least one Lambda role (with one or more policies attached to it) that you use in order attach to your Lambda Node.js code in order to control how it runs. When you find that Lambda role, you could attach the email policy that you just created to it as shown in this example.

(Enlarge)
  1. Finally, in your Lambda Node.js code as shown in this example, you set up the SES and then add code in order to send an email message.


About Joe