Compare instance reservations and running instances for AWS services
Clone or download
Pull request Compare This branch is 7 commits ahead, 30 commits behind TerbiumLabs:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.


You are running Kubernetes cluster on AWS and using Reserved Instances to save money. Also you are using DataDog to monitor things. This project can help you to be notified when you have Reserved Instance not in use or EC2 instance not being reserved.


You need:

  1. Create IAM role to allow script to talk to AWS API, check Required IAM Permissions.
  2. Deploy this project in your cluster, i.e. kubectl create -f
  3. Check DataDog metrics.
  4. Configure DataDog monitor to get notifications.

What the Metrics?

  1. {{ DD_METRIC }}.{{ TYPE }}.unused_reservations number of unused reservations (probably the best metric to monitor).
  2. {{ DD_METRIC }}.{{ TYPE }}.unreserved_instances number of instances running and not being reserved.
  3. {{ DD_METRIC }}.{{ TYPE }}.qty_running_instances number of running instances.
  4. {{ DD_METRIC }}.{{ TYPE }}.qty_reserved_instances number of reserved instances.

Where DD_METRIC is env variable (ri by default). And Type is: ec2, rds, elasticache.

Required IAM Permissions

The following example IAM policy is the minimum set of permissions needed to run the reporter:

    "Version": "2012-10-17",
    "Statement": [
            "Effect": "Allow",
            "Action": [
            "Resource": "*"


Original project:

If you need DevOps help, check