DEV Community

Cover image for TIL: How to Quickly Check Which AWS Regions Support SES Using a Bash Script
Nick Ciolpan
Nick Ciolpan

Posted on

TIL: How to Quickly Check Which AWS Regions Support SES Using a Bash Script

Although it has improved lately for some services, AWS is still notoriously unfriendly when it comes to checking which services are activated and running across different regions. Here's a script you can run in the console to quickly see which regions have SES (Simple Email Service) available:

#!/bin/bash
for region in $(aws ec2 describe-regions --query "Regions[].RegionName" --output text); do
    echo "Checking SES in region: $region"
    if output=$(aws ses get-send-quota --region $region 2>&1); then
        echo "SES is active in region: $region"
        echo "$output"
    else
        echo "SES is not available in region: $region"
    fi
    echo "---------------------------------------"
done
Enter fullscreen mode Exit fullscreen mode


`

This script loops through all AWS regions and checks if SES is running in each one, giving you a quick and easy overview of SES availability.

The output:

`
Checking SES in region: us-east-1
SES is active in region: us-east-1
{
"Max24HourSend": 50000.0,
"MaxSendRate": 14.0,
"SentLast24Hours": 0.0

}

Checking SES in region: us-west-1

SES is not available in region: us-west-1

Checking SES in region: eu-west-1
SES is active in region: eu-west-1
{
"Max24HourSend": 50000.0,
"MaxSendRate": 10.0,
"SentLast24Hours": 0.0

}

`

First appeared at: https://graffino.com/til/til-how-to-quickly-check-which-aws-regions-support-ses-using-a-bash-script

Top comments (0)