Skip to content

Instantly share code, notes, and snippets.

@chrisneal
Created September 15, 2025 11:34
Show Gist options
  • Save chrisneal/0cc26ec43dbe45e6b04edd8c2894ff44 to your computer and use it in GitHub Desktop.
Save chrisneal/0cc26ec43dbe45e6b04edd8c2894ff44 to your computer and use it in GitHub Desktop.
Export an AWS surpression list to a CSV
#!/usr/bin/env bash
NEXTTOKEN=
for (( ; ; ))
do
echo "NextToken: ${NEXTTOKEN}";
if [ -z "$NEXTTOKEN" ]; then
RESPONSE=$(aws sesv2 list-suppressed-destinations)
else
RESPONSE=$(aws sesv2 list-suppressed-destinations --next-token=${NEXTTOKEN})
fi
NEXTTOKEN=$(echo ${RESPONSE} | jq -r ".NextToken // empty")
if [ -z "$NEXTTOKEN" ]; then
break
fi
echo $RESPONSE | jq -r ".SuppressedDestinationSummaries[].EmailAddress" >> surpressedEmails.csv
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment