Clean up AWS resources with Janitor Monkey

by Alexander Weiß

It is very easy to allocate additional resources in AWS. A new instance is just five clicks away, a new EBS volume jsut three. It takes even less clicks to delete them, but deleting them seems to be not as enjoyable as creating new ones. So quite often companies pay for resources in the cloud which they don’t use. Janitor Monkey supports you in cleaning up the unused resources.

Back in the old days when you had to buy new hardware to set up a new server the uncontrolled growth of servers wasn’t a problem. But with the upcoming of virtualization it changed and the uncontrolled growth of servers became a problem. This problem still exists in the cloud. If the amount of cloud based servers is pretty low it is easy to spot unused resources. But if you have many instances running in different regions it is quite hard to keep an overview of which resources are needed and which one could be deleted. Janitor Monkey can help you to spot unused resources and get rid of them automatically.

Clean up AWS resources with Janitor Monkey

Clean up AWS resources with Janitor Monkey

Janitor Monkey is Open Source and is developed by Netflix. It is part of the company’s SimianArmy management tool set and makes use of the Asgard tool, which lets administrators delete resources manually. According to Netflix, Janitor Monkey has automatically deleted over 5000 resources from the company’s production and test environments. As the other tools from Netflix, Janitor Monkey is meant for enterprise organizations that employ a public cloud through AWS. The design of Janitor Monkey also makes it possible to customize it easily and use it with other cloud providers, too. However, Netflix itself operates through AWS and is one of the biggest customers of Amazon’s Web Services.

The resource clean up process

So how does Janitor Monkey work? It simply follows a process which is best described with “mark, notify, and delete”. Based on a set of rules it marks resources as a cleanup candidate. A rule could be something like this: If an Elastic Block Storage (EBS) volume has not been attached to an instance for 30 days, mark it. There various  rules and all of them are fully customizable.

If Janitor Monkey marks a resource an email is sent to whoever has been specified to receive it. The person behind the email account has to decide if she deletes the resource by herself, or if she wants that Janitor Monkey deletes the resource automatically. The later happens automatically after three days. So if the person does nothing, the resource will be gone after three days. The person can also decide to flag the resource. The flag tells Monkey Janitor that the resource is still needed and it won’t be deleted. The three days period between the marking and the cleaning up can be changed to a higher value if needed.

If a resource is flagged, Janitor Monkey will ignore the resource from now on. Janitor Monkey ignores the resource only as long as the status of the resource hasn’t changed. If the status of the resource changes, e.g. the EBS Volume gets attached to an instance, Janitor Monkey will monitor the resources again. There’s also the option to delete a flag manually.

Is it too early for a spring-cleaning? In this case I would say no. If you have a decent cloud environment running in the AWS cloud, you should try out Janitor Monkey as soon as possible. It can save you some bucks. You can find Janitor Monkey on this github site.

VN:F [1.9.22_1171]
Rating: 6.0/10 (1 vote cast)
VN:F [1.9.22_1171]
Rating: 0 (from 0 votes)
Clean up AWS resources with Janitor Monkey, 6.0 out of 10 based on 1 rating