Shared Go libraries for finding and buying cloud commitments (Reserved Instances, Savings Plans and committed use discounts) on AWS, Azure and GCP. The packages hold the provider integrations, the recommendation types and the scoring and filtering logic that the CUDly CLI, the MCP server and the self-hosted platform all build on.
This repository is a set of libraries, so there's no binary to install. Purchase confirmation, dry-run policy and other safety controls live in the callers, and any caller that executes a purchase can spend money.
The repository has five Go modules and no root module, so run Go commands from inside a module directory.
| Module | Contents |
|---|---|
pkg |
Provider interfaces and shared domain packages: common types and JSON codecs, provider credential detection and discovery, scorer and recfilter for ranking and filtering recommendations, reccontract for the recommendation request contract, exchange for AWS Convertible RI exchanges, ladder for commitment-laddering plans, retry, httpclient, concurrency, logging, reporter and insurance for Archera insured-commitment quotes and eligibility |
providers/aws |
AWS integration with service clients for EC2, RDS, ElastiCache, MemoryDB, OpenSearch, Redshift and Savings Plans |
providers/azure |
Azure integration, including Advisor-based recommendations across subscriptions |
providers/gcp |
GCP integration |
ci_cd_sanity_tests |
Diagnostic checks that call real cloud APIs, used by the sanity workflows and not meant for end users |
Provider support varies by service and account. RDS and ElastiCache on AWS are the tested paths, and the other AWS services, Azure and GCP are experimental.
There are no tags or releases yet, so consumers pin a commit. For example:
go get github.com/LeanerCloud/cloud-commitments-go/pkg@main
go get github.com/LeanerCloud/cloud-commitments-go/providers/aws@mainEach module requires the Go version declared in its go.mod (currently 1.26.11). The CLI shows the pattern in its own go.mod, which pins all four library modules to the same pseudo-version.
make build
make test-unitBoth targets loop over every module. Unit tests run with -race -short and need no cloud credentials. To check one module the way an external consumer sees it, without the workspace:
(cd pkg && GOWORK=off go test -race -short ./...)Don't run the binaries under ci_cd_sanity_tests/cmd/ unless you mean to hit the account your credentials point at. The full pre-merge set is make ci, which runs format, vet, complexity, unit tests and a security scan.
Read CONTRIBUTING.md first, and report security problems as described in SECURITY.md. Design notes are under docs/design, and CHANGELOG.md tracks changes.
These defaults apply when a caller leaves the value unset. They are kept as they are and listed here so callers can override them.
| Default | Value | Where | Effect |
|---|---|---|---|
| Coverage and utilization lookback | 30 days | providers/aws/recommendations/coverage.go:242-243 (coverageWindow), providers/aws/recommendations/utilization.go:41-42, providers/aws/ladder/ladder.go:19 (DefaultLookbackDays) |
A non-positive lookbackDays passed to GetRICoverageMap or GetRIUtilization is replaced with 30. The ladder uses 30 when Config.LookbackDays is zero. Pass an explicit window to size from a different history. |
| MemoryDB reserved-node engine | redis |
providers/aws/services/memorydb/client.go:329 (ReservedNodeEngine), used at providers/aws/recommendations/parser_services.go:260 |
Every MemoryDB recommendation is labelled redis, including Valkey clusters. The MemoryDB purchase path does not filter on engine, so the label affects display, pool keys and duplicate detection only. |
Built by LeanerCloud, a group of AWS cost optimization and FinOps specialists, also authors of AutoSpotting.
Development is sponsored by Archera, which funds it from insurance purchases made through that page. Archera can insure the Savings Plans, Reserved Instances and CUD purchases you make with this tool.
If this tool saves you time and money, please give us a ⭐ so others can also find it.
cloud-commitments-go is maintained by LeanerCloud and licensed under the Open Software License 3.0. Third-party notices are in NOTICE.