Skip to content
A simple garbage collector for SQS queues
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
vendor/github.com
Dockerfile
Gopkg.lock
Gopkg.toml
LICENSE
README.md
main.go

README.md

sqs-gc

A simple garbage collector for SQS queues

List all SQS queues in your account, fetches the cloudwatch metrics and deletes the ones for which the ApproximateAgeOfOldestMessage is greater than the provided value.

The program would run once only.

Usage

Download it: go get github.com/tjamet/sqs-gc

run it:

sqs-gc --help
Usage of sqs-gs:
  -delete-really
        Provide this flag to actually perform the deletion
  -max-age float
        The threshold (seconds) after which if a queue with a message this old will be listed for deletion (default 1e+06)
  -queues string
        Provide a pattern queues to delete must match. Matching will be done using the fnmatch pattern (see https://golang.org/pkg/path/filepath/#Match) (default "*")

Run periodically

Run the script in a cron tab, or a kubernetes cronjob to periodically cleanup your SQS queues

You can’t perform that action at this time.