Automatically Pausing Email
Sending for Your Amazon SES Account

The procedures in this section explain the steps to set up Amazon SES, Amazon SNS,
Amazon CloudWatch, and
AWS Lambda to automatically pause email sending for your Amazon SES account in a single
AWS
Region. If you send email from multiple regions, repeat the procedures in this section
for
each region in which you want to implement this solution.

Use the region selector to choose the region in which you want to deploy this
Lambda function.

Note

This function only pauses email sending in the AWS Region you select in
this step. If you send email from more than one region, repeat the
procedures in this section for each region in which you want to
automatically pause email sending.

Verify that the code in the Lambda function does not contain any
errors. The Lambda code editor automatically highlights syntax errors and
other potential issues.

Part 3: Re-Enable
Email Sending for Your Account

A side effect of testing the Lambda function in Part 2: Create the
Lambda Function is that email
sending for your Amazon SES account is paused. In most cases, you do not want to pause
sending for your account until the CloudWatch alarm is triggered.

The procedures in this section re-enable email sending for your Amazon SES account.
To
complete these procedures, you must install and configure the AWS Command Line Interface.
For more
information, see the AWS Command Line Interface User Guide.

Part 5: Create a
CloudWatch Alarm

This section contains procedures for creating an alarm in CloudWatch that is triggered
when
a metric reaches a certain threshold. When the alarm is triggered, it delivers a
notification to the Amazon SNS topic you created in Part 4: Create an
Amazon SNS Topic, which then executes
the Lambda function you created in Part 2: Create the
Lambda Function.

Reputation.BounceRate – Choose
this metric if you want to pause email sending for your account when the
overall hard bounce rate for your account crosses a threshold that you
define.

Reputation.ComplaintRate – Choose
this metric if you want to pause email sending for your account when the
overall complaint rate for your account crosses a threshold that you
define.

Choose Next.

Complete the following steps:

Under Alarm Threshold, for
Name, type a name for the alarm.

Under Whenever: Reputation.BounceRate or
Whenever: Reputation.ComplaintRate, specify the
threshold that causes the alarm to trigger.

Note

Your account is automatically placed under review if your bounce
rate exceeds 10%, or if your complaint rate exceeds .5%. When you
specify the bounce or complaint rate that causes the CloudWatch alarm to
trigger, we recommend that you use values that are below these rates
to prevent your account from being placed under review.

Replace MyAlarm in the preceding command with the
name of the alarm you created in Part 5: Create a
CloudWatch Alarm, and replace
us-west-2 with the region in which you want to
automatically pause email sending.

Note

When you execute this command, the status of the alarm switches from
OK to ALARM and back to OK within
a few seconds. You can view these status changes on the alarm's
History tab in the CloudWatch console, or by using the
DescribeAlarmHistory operation.

At the command line, type the following command to check the email sending
status for your account: aws ses get-account-sending-enabled --region
us-west-2

If the Lambda function executed successfully, you see the following
output: