Created
September 6, 2021 13:44
-
-
Save alexandrerocco/617f9be5ce6c493e4b848378396aff40 to your computer and use it in GitHub Desktop.
Deletes test or old AWS SQS queues that matches the prefix
This file contains 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
prefix=your-queue-prefix" | |
region="your-region" | |
queues=$(aws sqs list-queues --queue-name-prefix $prefix --region $region) | |
for q in ${queues[@]} | |
do | |
if [ "${q:0:1}" == "\"" ]; then | |
x=${q:1:${#q}-3} | |
if [ $x != "QueueUrls" ]; then | |
aws sqs delete-queue --region $region --queue-url $x | |
fi | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment