https://github.com/habx/aws-mq-cleaner
Clean aws sns/sqs
https://github.com/habx/aws-mq-cleaner
aws golang sns sqs
Last synced: about 1 year ago
JSON representation
Clean aws sns/sqs
- Host: GitHub
- URL: https://github.com/habx/aws-mq-cleaner
- Owner: habx
- License: mit
- Created: 2020-03-18T09:11:31.000Z (over 6 years ago)
- Default Branch: dev
- Last Pushed: 2023-01-08T22:18:47.000Z (over 3 years ago)
- Last Synced: 2025-03-25T23:41:44.811Z (over 1 year ago)
- Topics: aws, golang, sns, sqs
- Language: Go
- Homepage:
- Size: 801 KB
- Stars: 8
- Watchers: 2
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# aws-mq-cleaner
[](https://codecov.io/gh/habx/aws-mq-cleaner)
[](https://github.com/habx/aws-mq-cleaner/releases/latest)
[](https://golang.org/doc/devel/release.html)
[](https://hub.docker.com/r/habx/aws-mq-cleaner)
[](https://app.circleci.com/pipelines/github/habx/aws-mq-cleaner)
[](/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](docs/aws-mq-cleaner.md). The tag format shall be in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601).
## Install
### Docker
```bash
docker pull habx/aws-mq-cleaner
docker container run --rm habx/aws-mq-cleaner --help
```
### Binary
#### MACOS
Set VERSION
```bash
VERSION=vx.x.x wget https://github.com/habx/aws-mq-cleaner/releases/download/${VERSION}/aws-mq-cleaner_darwin_amd64.gz
```
#### LINUX
```bash
VERSION=vx.x.x wget https://github.com/habx/aws-mq-cleaner/releases/download/${VERSION}/aws-mq-cleaner_linux_amd64.gz
```
### go source
```bash
go get -t github.com/habx/aws-mq-cleaner
aws-mq-cleaner --help
```
## Docs
[Docs](docs/aws-mq-cleaner.md)