Created
September 15, 2025 11:34
-
-
Save chrisneal/0cc26ec43dbe45e6b04edd8c2894ff44 to your computer and use it in GitHub Desktop.
Export an AWS surpression list to a CSV
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
| #!/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