Skip to content

Latest commit

 

History

History
223 lines (212 loc) · 14.4 KB

CHANGELOG.md

File metadata and controls

223 lines (212 loc) · 14.4 KB

Changelog

All notable changes to the CUDly CLI are documented in this file. The format is based on Keep a Changelog.

[Unreleased]

Added

  • archera-comparison command: a read-only, default-off comparison of an Archera commitment plan (table or JSON). See docs/cli/archera-comparison.md (#2156).
  • archera-recommendation-quote command: a read-only, default-off Archera quote for one recommendation, shown only on an exact match (table or JSON). See docs/cli/archera-recommendation-quote.md.
  • --ri-account-scope flag (linked default, payer) for Reserved Instance recommendations, mirroring --sp-account-scope (#2181).

Changed (cloud-commitments-go bump)

  • Bumped cloud-commitments-go (pkg and the AWS, Azure and GCP providers) to e0d8a7e. Behavior you can see:
    • The rebuy expiry adjustment now fails closed: an expiring commitment with an unknown service or EC2 size fails the run instead of being skipped.
    • Savings Plans purchases first confirm a stored offering id with a read-only DescribeSavingsPlansOfferings call and refuse a mismatch.
    • ElastiCache coverage and expiry pools are keyed by cache engine, so the Cost Explorer coverage request gains a CACHE_ENGINE group.
    • MemoryDB calls use the rpc-v2-cbor protocol through its newer SDK.
    • The duplicate-purchase check starts every term and payment variant from the full held quantity, counts RDS size-flexible reservations in units and EC2 size-flexible ones in normalized units; counts only go down or stay.
    • A fractional Cost Explorer quantity now rounds down instead of half up and its upfront, savings and on-demand figures scale with the bought count; a row that rounds to 0 carries no savings percentage and is dropped by --min-savings-pct. Example for quantity 2.5: count 3 became 2, upfront 2500 became 2000.
    • Purchases fail closed when several EC2 reservations carry the same idempotency token, when a Redshift node belongs to another purchase lineage, or when a count does not fit int32.

Fixed

  • Bump Go to 1.26.10 to pick up the fix for GO-2026-6809 (crypto/x509), which govulncheck now reports against 1.26.9.

  • --max-instances drop summary: a zero-Count recommendation swept out by the --min-count floor no longer drives the tally negative (which panicked in DropSummary.Add), and removed zero-Count entries are now counted and named (#1742).

  • --target-coverage RDS recommendations now report a ProjectedCoverage that matches the final count after --max-instances, --count-override or the duplicate-RI check lowered it, instead of the pre-cap family value (#2214).

  • --max-instances and --min-count no longer apply to Savings Plans, whose Count of 1 is not an instance count: a Savings Plan neither uses up the instance cap nor is dropped by the floor (#1613).

  • configure-azure and configure-gcp now fail when listing the credentials secret fails (for example access denied) instead of proceeding to the update and looking successful; ListSecrets also reads every result page (#1613).

  • configure-azure --client-secret is deprecated (it still works): omit it and enter the secret at the interactive prompt (#1613).

  • The configure-azure help no longer shows --client-secret in its example; the client secret is read from the interactive prompt (#1613).

  • configure-azure and configure-gcp now store credentials in the secret whose name matches exactly instead of the first prefix match from Secrets Manager (which could be <name>-old), and fail when two secrets share the name (#1613).

  • The RDS engine-version scan now stops on cancellation and fails with an error naming the region after 200 pages of DescribeDBInstances instead of paging without bound (#1613).

  • configure-azure no longer creates the Entra app, client secret and role assignment when you press Enter at the create-service-principal prompt; Enter now skips, as in the GCP wizard (#1613).

  • --input-csv now rejects a row whose Service cell is not one of the service names the CSV report writes (for example the --services alias elasticsearch, RDS or rds with a trailing space), and a Count above 10000, failing the load with the row and column. Such a row used to load and then be skipped mid-run with "Service client not yet implemented" (#379).

  • Savings Plans purchases now send the hourly commitment truncated to 5 decimals (at least 2 shown) instead of rounded to cents, and accept amounts from 0.001 to 1,000,000, so a 0.001 to 0.004 commitment is no longer rejected (library bump, #2235).

  • --target-coverage with --rebuy-window-days no longer buys replacement EC2 and other non-RDS RIs again when they were already bought inside the coverage lookback: the expiring RIs are netted against those replacements (#2235).

  • --rebuy-window-days with --target-coverage now refuses to run (exit 1, no CSV, dry runs included) when the credentials' account does not own all the in-scope RI usage, instead of netting one account's expiring RIs against broader demand. Member accounts of an AWS Organization are refused. A failed STS lookup, role check, scope probe (new Cost Explorer GetReservationCoverage query grouped by linked account) or RI inventory read also exits 1 on these runs. These runs now need the read-only organizations:DescribeOrganization permission (#2131).

  • --min-savings-pct and --max-break-even-months now apply on --input-csv runs instead of being refused. The CSV report gains SavingsPercentage and BreakEvenMonths columns; replaying a report that lacks a column a set flag needs (or has it blank) fails with an error naming the flag, never reading the missing figure as 0. When present, the SavingsPercentage and BreakEvenMonths columns are now parsed strictly (an invalid value fails the load) even when the threshold flags are unset. --max-instances still ranks on savings per instance (#1819).

  • Zonal EC2 rows now keep their Availability Zone through the CSV report and --input-csv: reports gain an AvailabilityZone column, appended after Scope (blank for regional rows and other services). A dry run now refuses a zonal EC2 row without an AZ, or a regional row that names one, the same way the real run does, instead of reporting success. A zonal row from a CSV written before this column existed is refused until its AZ is added (#2174).

  • Recommendations with no account ID or name are now reported in the drop summary when an account filter (--include-accounts or --exclude-accounts) removes them (#1613).

  • A dry run now refuses an EC2 Instance Savings Plan that has no instance family and no offering ID, the same way the real run does, instead of reporting success for a purchase the offering lookup would reject (#2164).

  • A purchase result with Success=true and a non-nil Error is now treated as a failure in the Ctrl-C summary, the audit-stop message, the per-service success/failed counts and the non-zero exit. The CSV Success column keeps the raw provider flag; read the Error column alongside it (#2205).

  • configure gcp: pressing Enter at a [r]un, [S]kip (default)? step now skips instead of creating the service account, granting roles, minting a key or running gcloud auth login; type r to run a step (#1613).

  • configure gcp key cleanup: the minted key is now deleted when the upload panics, a second Ctrl-C aborts the cleanup, the local key file is removed first, and a possibly orphaned key is reported when CreateKey fails ambiguously (cancellation, timeout, 5xx or network error), with the gcloud commands to list and delete it (#2117).

  • --min-savings-pct now rejects values below 0 or above 100 at validation. Previously a negative value was accepted as no filter and a value above 100 silently dropped every recommendation (#2161).

  • Replaying or retrying an --input-csv purchase no longer re-buys an ElastiCache or MemoryDB reservation that the first run already bought: CSV rows now carry the AWS provider, and MemoryDB rows use the engine AWS reports for existing nodes whatever the CSV says, so the duplicate check matches them. CSV Savings Plan rows also now match --include-regions and --exclude-regions on their plan region (#2228).

  • configure-gcp: skipping (or giving an unknown answer at) the "Create Service Account" step no longer continues with the default cudly-service-account@<project> email that was never created. The wizard now asks for the existing service account email, validates it as a *.gserviceaccount.com address, and uses it for the role grant and key steps (#2211).

  • When --max-instances, --count-override or the duplicate-RI check lowers a recommendation's count, ProjectedCoverage and ProjectedUtilization are re-derived for the new count instead of reporting the figures sized for the original count. This applies to RI rows with a usage signal; ProjectedCoverage is only re-derived when existing coverage is known. Savings Plans and projections that were never computed are left as they are. The Redshift NumberOfNodes now follows the count, including after --coverage and --target-coverage sizing. RDS ProjectedCoverage is a family-wide figure and is not re-derived yet; see issue #2214 (#2206).

  • An explicit --output path that already exists (file, directory or symlink) is now refused during validation instead of being silently truncated. Choose a new path or remove the old file; scripts that reuse one path must do the same. Auto-generated filenames are unaffected (#2050).

  • --regions now also narrows EC2 Instance Savings Plan recommendations to the listed regions by the plan's own region (previously only --include-regions did); a plan with no known region is dropped. Compute, SageMaker and Database plans stay unfiltered. In --input-csv mode --regions still does not narrow Savings Plans (rows are used as supplied).

  • A --purchase run now stops, and exits 1, when an audit record cannot be written durably (disk full, log removed or made unwritable mid-run) instead of warning and buying more with no audit trail. The audit log is also probed before each real purchase, so a log that broke after the start-of-run check stops the run before buying. The report and summary for what already ran are still written, and the message says how many recommendations were attempted and to verify in AWS before re-running. Applies to the main pipeline and --input-csv; dry runs still only warn (#2103).

  • Stop silently disabling the extended-support exclusion when AWS queries fail. A failed engine lifecycle query or region listing now aborts the run before any purchase; an RDS recommendation in a region whose instance inventory could not be read aborts it too, while other regions proceed with a warning. The queries are skipped entirely under --include-extended-support or when no RDS recommendations are in scope (#2147).

  • Ctrl-C now cancels the whole invocation instead of only setting a flag that was polled between purchases. The engine-version lifecycle queries, region discovery, recommendation fetch, coverage fetch and duplicate checks treat a canceled or expired context as terminal (the run stops and buys nothing) instead of continuing with empty lifecycle data, "no recommendations" or un-deduplicated counts. A purchase already in flight is not aborted: it finishes, is written to the audit log (before the delay between purchases, which the --input-csv path used to run first), and the report and an "interrupted: N of M attempted" summary are still produced. Errored purchases in an interrupted run are flagged "verify in AWS before re-running". Further Ctrl-Cs are absorbed; Ctrl-\ force-quits and may lose the in-flight audit record (#2151).

  • Reject NaN and infinite values for --coverage, --target-coverage, --min-pool-size and --min-savings-pct before any API call. NaN used to pass validation and silently switch --target-coverage runs to --coverage sizing (#2136).

  • --include-accounts and --exclude-accounts are both exact now: they match the account name or ID exactly (case-insensitive, surrounding whitespace ignored) instead of by substring. Previously --include-accounts dev also selected devops-prod, so a purchase run could buy in accounts that were not named. Behavior change: anyone relying on substring matching must now list the full account names or IDs. An --exclude-accounts value that matches no account exactly but is part of account names now stops the run, naming those accounts, instead of being applied as a substring (#2237).

Changed

  • --coverage-lookback-days is now capped at 365 for every --target-coverage run, not only gated rebuy runs; values from 366 up to about 395, previously accepted, are now rejected. The gated rebuy scope probe also starts two days earlier than the longer lookback window, so it can only refuse more.
  • Bump cloud-commitments-go to dcb5ba0: Azure reservation purchases use one shared helper with aligned guards, error messages and display names, and hold the shared concurrency slot per call instead of per batch; the AWS provider gains a configurable account scope for RI purchase recommendations and an exported RederiveFamilyCoverage for post-sizing count changes.
  • Bumped cloud-commitments-go (pkg and the aws, azure and gcp providers) to cfe8ac29. User-visible effects: recommendations reported in a non-USD currency are skipped at ingestion and the skip is reported; RDS SQL Server RIs are sized per instance size; GCP no longer emits Cloud SQL and Memorystore CUD recommendations from the performance recommenders; Azure Savings Plan purchases refuse a malformed idempotency token (#1613).
  • BREAKING: --input-csv now requires Term and PaymentOption columns in addition to Service, Region, ResourceType and Count. Term must be 1yr or 3yr and PaymentOption must be all-upfront, partial-upfront or no-upfront on every row. CSVs with only the older four columns, or with a blank or unknown value, now fail to load with an error naming the missing column or the row.
  • Split the CLI out of the CUDly monorepo into its own module, github.com/LeanerCloud/cloud-commitments-cli. The shared client and provider code it depends on now lives in github.com/LeanerCloud/cloud-commitments-go, pinned in go.mod. History predating the split lives in the monorepo's changelog.