Skip to content

GetCostAndUsageComparisons

Source: src/AWS/CostExplorer/GetCostAndUsageComparisons.ts

Runtime binding for ce:GetCostAndUsageComparisons.

Compare cost and usage between two periods within the last 13 months (up to 38 months with multi-year data enabled). Provide the implementation with Effect.provide(AWS.CostExplorer.GetCostAndUsageComparisonsHttp).

// init — account-level binding takes no resource
const getCostAndUsageComparisons = yield* AWS.CostExplorer.GetCostAndUsageComparisons();
// runtime
const result = yield* getCostAndUsageComparisons({
BaselineTimePeriod: { Start: "2026-05-01", End: "2026-06-01" },
ComparisonTimePeriod: { Start: "2026-06-01", End: "2026-07-01" },
MetricForComparison: "UnblendedCost",
});