Skip to content

habx/aws-mq-cleaner

Repository files navigation

aws-mq-cleaner

codecov Release Go version Docker CircleCI License

About

aws-mq-cleaner is a tool to remove unused SQS queues and SNS topics.

Deletion method

SQS

We're getting the metrics from Cloudwatch. If NumberOfMessagesReceived and NumberOfEmptyReceipts are set to zero, we're considering the queue to be unused.

SNS

If subscriptionsConfirmed and subscriptionsPending are at zero, we're considering the topic to be unused.

NOTE: You can add a tag to read an "update date" to prevent a topic without subscriptions to be deleted. The tag name is configurable, you can define it via the Docs. The tag format shall be in ISO-8601.

Install

Docker

docker pull habx/aws-mq-cleaner
docker container run --rm habx/aws-mq-cleaner --help

Binary

MACOS

Set VERSION

VERSION=vx.x.x wget https://github.com/habx/aws-mq-cleaner/releases/download/${VERSION}/aws-mq-cleaner_darwin_amd64.gz

LINUX

VERSION=vx.x.x wget https://github.com/habx/aws-mq-cleaner/releases/download/${VERSION}/aws-mq-cleaner_linux_amd64.gz

go source

go get -t github.com/habx/aws-mq-cleaner
aws-mq-cleaner --help

Docs

Docs