Created
February 21, 2025 15:18
-
-
Save shayaantx/114fd7bdf60d408e576acaca31b5d9d0 to your computer and use it in GitHub Desktop.
page through aws account suppression emails
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
next_token="" | |
max_results=10 | |
while true; do | |
if [ -z "$next_token" ]; then | |
response=$(aws sesv2 list-suppressed-destinations) | |
else | |
echo "next page" | |
response=$(aws sesv2 list-suppressed-destinations --next-token "$next_token") | |
fi | |
echo "$response" | jq '.SuppressedDestinationSummaries[] | {EmailAddress: .EmailAddress, Reason: .Reason}' | |
next_token=$(echo "$response" | jq -r '.NextToken') | |
if [ "$next_token" == "null" ]; then | |
break | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment