Skip to content

Latest commit

History

History
100 lines (59 loc) 路 4.8 KB

SETUP.md

File metadata and controls

100 lines (59 loc) 路 4.8 KB

AWS SNS Setup Instructions

Create an SNS Topic

Visit the AWS Simple Notifications Service (SNS) home page and create a new topic: https://eu-west-1.console.aws.amazon.com/sns/v3/home

new-sns-topic

We called ours SESNotifications and then clicked Next step. You will see a page where you can configure your SNS topic:

create-sns-topic-1

Ignore all the optional configurations and just scroll to the bottom of the page and click Create topic:

create-sns-topic-2

You will then see a confirmation page saying your topic was created successfully:

ses-topic-created

Create SNS Subscription to the Topic

On this page, scroll till you find the Create subscription button: (Click it)

sns-create-subscription

Once you have selected/input the relevant data, click the Create subscription button:

aws-sns-create-subscription

You should see a confirmation that your subscription was created successfully:

sesnotifications-subscription-created

Configuring Notifications on Amazon SES Console

This section follows and expands on the official instructions: https://docs.aws.amazon.com/ses/latest/DeveloperGuide/configure-sns-notifications.html

Once you have created the SNS Topic, visit the SES home page and click on Email Addresses: https://eu-west-1.console.aws.amazon.com/ses

aws-ses-console-home

Click on the verified email address you want to configure SNS notifications for:

aws-ses-email-address-no-topics

In the Notifications section, click on Edit configuration:

aws-ses-edit-configuration

Select the SNS topic we created above for all the types of notification then click Save Config:

aws-ses-sns-notifications-edit-configuration

Your configuration should now look something like this:

aws-ses-sns-notificaitons-updated

Test it!!

In the Lambda configuration page https://eu-west-1.console.aws.amazon.com/lambda/home?region=eu-west-1#/functions/aws-ses-lambda-v1 configure a bounce event to an email address you know does not exist:

configure-bounce-test-event

Run the bounce event in the Lambda console:

lambda-bounce-test

You will see a "success" message confirming that the aws-ses-lambda attempted to send the email to the bounce@dwyl.com address (which we know will fail). Our lambda function and AWS SES does not know that the bounce@dwyl.com address will bounce. That's the reason we need to have the SNS topic so we can monitor bounce events!

The SNS bounce notification event is saved to S3 thanks to #12 https://ademoapp.s3-eu-west-1.amazonaws.com/event.json bounce-event-saved

For the purposes of testing our parser, we save this event JSON in: test/fixtures/sample_sns_bounce.json

Now we can parse the notification!