- Newest
- Most votes
- Most comments
Unfortunately, CloudWatch Metric Math can’t create a true rolling 24-hour window on its own. The 24-hour period you set in CloudWatch is fixed to the calendar day — it doesn’t slide forward hour by hour like AWS SES does for quota tracking.
Here’s what you can do instead:
Use a Lambda function:
Set up a Lambda (via EventBridge) to run every hour.
Have it pull the last 24 hours of SES “Send” metrics using the GetMetricData() API.
Calculate the total sends from the past 24 hours and push that number to a custom CloudWatch metric.
Create an alarm based on that custom metric to trigger when it hits 80% of your quota.
Or use the SES API directly:
The GetSendStatistics API gives data that already matches SES’s rolling 24-hour window.
You can use that for alerts or dashboards instead of trying to simulate it in CloudWatch.
Hi,
I am very puzzled by the question and answers given here, as CloudWatch does create a sliding window by default. CloudWatch behaviour is exactly the opposite of what you describe: using Period 86400 and EvaluationPeriods 1 creates a continuously rolling 24-hour window where the window slides every minute! If you experience something different, did you check that the metric is indeed refreshed? Otherwise, you might need to please share more details about your use case, as CloudWatch does evaluate sliding window.
answered 10 months ago
Yes, you can create a true 24-hour rolling sum for SES quota monitoring using CloudWatch Metric Math.
Amazon SES sending quotas are calculated on a rolling 24-hour period, where AWS determines the number of emails you've sent in the previous 24 hours each time you try to send an email. To mirror this behavior in CloudWatch, you can use metric math expressions.
Here's how to approach this:
- Use a 1-hour period for your base SES sending metric (this gives you hourly data points)
- Create a metric math expression that sums the last 24 data points
- Set up your alarm on this expression
The key is to use a metric math expression that performs a rolling sum over the last 24 hours. When CloudWatch evaluates alarms, it aggregates periods into single data points, which allows you to create this rolling window effect.
For your alarm configuration:
- Set the Period to 1 hour (3600 seconds)
- Use a metric math expression that sums the last 24 data points
- Set the alarm threshold to 80% of your daily quota
- Configure appropriate evaluation periods (e.g., 1 out of 1)
This approach will give you a continuously updating view of your SES usage over the past 24 hours, similar to how AWS calculates the quota internally. The alarm will trigger when your rolling 24-hour usage exceeds 80% of your daily quota, giving you time to take action before hitting your limit.
You can create this alarm directly through the Service Quotas console, which provides a simplified interface for setting up CloudWatch alarms on service quotas, including SES sending quotas.
Sources
Managing your Amazon SES sending quotas - Amazon Simple Email Service
Create a CloudWatch alarm based on a metric math expression - Amazon CloudWatch
Service Quotas and Amazon CloudWatch alarms - Service Quotas
Custom metrics and extended metrics that you can send to CloudWatch - Amazon CloudWatch
answered 10 months ago
Relevant content
asked a year ago
asked 2 years ago
asked 2 years ago
- AWS OFFICIALUpdated 5 months ago

I believe the core issue is that the SES sending quota is continuously re-evaluated within a rolling 24-hour window, rather than being checked once per period as CloudWatch alarms do. Unless there is some advanced Metric Math you can do, the custom Lambda, though I’d have hoped to avoid it, appears to be the best solution.