Last active
January 8, 2018 21:25
-
-
Save alexturek/4c4a005918cd75220dc48dd31256e8cd to your computer and use it in GitHub Desktop.
Deletes all SQS topics prefixed by something
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 | |
# Delete all SQS queues with a specified prefix (up to 1000 at a time) | |
# SQS won't list more than 1000 queues at a time, so you may need to run this multiple times. | |
# Usage | |
# | |
# ./delete-sqs-queues-like.sh test- | |
# | |
# Requires `parallel` and `awscli` | |
queueUrl=$1 | |
aws sqs delete-queue --queue-url $queueUrl | |
echo "$queueUrl" >> deleted-queues |
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 | |
QUEUE_PREFIX=$1 | |
aws sqs list-queues --queue-name-prefix $1 | jq -r .QueueUrls[] > queues-to-delete | |
parallel -j 5 delete-queue.sh < queues-to-delete |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Related: sns