LeanerCloud Optimizer
p/leanercloud-optimizer
AWS cost optimization CLI tool for RDS,EBS and Elasticache
Cristian Măgherușan-Stanciu

LeanerCloud Optimizer — AWS cost optimization CLI tool for RDS,EBS and Elasticache

Rightsizes AWS resources such as RDS databases and ElastiCache clusters to match their actual capacity requirements. It also converts them to Graviton instances, often using burstable instance types for lowest possible costs and reduced carbon footprint.
Replies
Best
Cristian Măgherușan-Stanciu
Hey there, For a little background, I'm a solopreneur/freelancer focused on helping startups and scaleups optimize their cloud costs. I previously used to work at AWS for a few years as Specialist Solution Architect for Spot and Graviton. I mostly offer services, but also building tools to accelerate my work as much as possible since I only charge a cut of the savings. Some of these tools may also be useful to others and I sell them for some extra income. Over multiple customer engagements I noticed again and again that RDS databases are heavily oversized, especially on dev environments and sometimes have expensive IO1 volumes attached to them. I usually convert them to the smallest instance that covers the needs of the database, indicated by the CloudWatch metrics. Typically for dev environments utilization is very low so the best instances are Graviton burstable instances, which often cost much less than the initial configuration, anywhere between 50% and 90% less. After doing it manually a few times (it's quite a time consuming, boring and error prone operation if you have many databases), I started to build automation for these actions, which eventually matured into this command line tool. It does in seconds the same things I would do manually in hours: looking at the metrics for each database, considers available instance types and selects the best one that fits the needs of the workload, and applies the change. It looks and feels much like Terraform, having plan and apply modes, and it's meant to be used interactively by technical people like DevOps engineers. Here's how it works: This command will run in plan mode against all supported resources from your AWS account (so far it supports EBS volumes, RDS databases and ElastiCache clusters): ./optimizer plan --tag_filtering_mode=opt-out --all_optimizations You can then run it in apply mode against all resources tagged in a certain way: ./optimizer apply --tag_filtering_mode=opt-in --all_optimizations --tag_filters env=dev The changes will then be applied in the next maintenance window unless forced to apply immediately by adding a command line flag. See the --help for all the available command line flags. If you use IaC tools like Terraform, you will then need to reconcile the drift manually, or just configure Terraform to ignore some of the fields set by this tool if you plan to use it regularly.