Skip to content

Instantly share code, notes, and snippets.

@shayaantx
Created February 21, 2025 15:18
Show Gist options
  • Save shayaantx/114fd7bdf60d408e576acaca31b5d9d0 to your computer and use it in GitHub Desktop.
Save shayaantx/114fd7bdf60d408e576acaca31b5d9d0 to your computer and use it in GitHub Desktop.
page through aws account suppression emails
#!/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