Looking for an easy way to bulk delete SQS queues and SNS topics
When we started out with Rekognition we had a ton of SQS queues as well as SNS topics created automatically. I'm looking for the best and or easiest way to bulk delete these resources. Hoping someone here has an answer or at least some insight.
Make a python scripts.
First do a list_.... (inlcuding paging) collecting all the arns or names of the resources).
Then make a loop to delete them one by one.
queues =  token = None while True: if token == None: response = client.list_queues() else response = client.list_queues( NextToken=token ) token = response['NextToken'] queues.extend(response['QueueUrls']) if token == None: break for queue in queues: response = client.delete_queue( QueueUrl=queue )
Has this worked for you in the past? I have tried this before and didn't have any luck.
Scripting has worked for me in many cases. Not specifically queues or topics. Usually you would setup the topic/queues using CloudFormation/terraform/cdk (IaC) and the tool would take care of properly (batch)destroying. I added the code for queues (including paging which you might have forgotten in your previous attempt).
Question though: you see using Rekognition these queues and topics got auto created? You mean by using the Rekognition console?
What are the pros/cons and use cases of using EventBridge, Lambda with queues, and SNS for event-driven architectures?Accepted Answerasked 2 years ago
Do we need VPC Endpoints for SNS and SQS if data not originating from any VPC and directly landing in SNS from external sourceasked 5 months ago
CloudFormation Nonsense: Seven (7) SNS Subscriptions created for SQS Queues by a Templateasked 5 months ago
SQS not receiving SNS messageasked 3 years ago
Availability of SQS Temporary and Virtual Queues in Languages Other Than Java.asked 6 months ago
What is the best way to work with SQS queues in local environments?Accepted Answerasked 7 months ago
Looking for an easy way to bulk delete SQS queues and SNS topicsasked a month ago
Is there a limitation on the number of topics in IoT Core?Accepted Answerasked 2 years ago
Property Topics cannot be empty - Cloudformation CREATE_FAILED on SNS TopicPolicyAccepted Answerasked 3 months ago
Textract using FIFO SNS topics and FIFO SQS queuesasked a year ago