GetCostAndUsageWithResources
Source:
src/AWS/CostExplorer/GetCostAndUsageWithResources.ts
Runtime binding for ce:GetCostAndUsageWithResources.
Query cost and usage at individual-resource granularity (EC2
instance ids etc.). Requires resource-level data to be enabled in Cost
Explorer settings and only covers the trailing 14 days. Provide the implementation with
Effect.provide(AWS.CostExplorer.GetCostAndUsageWithResourcesHttp).
Querying Cost and Usage
Section titled “Querying Cost and Usage”// init — account-level binding takes no resourceconst getCostAndUsageWithResources = yield* AWS.CostExplorer.GetCostAndUsageWithResources();
// runtimeconst result = yield* getCostAndUsageWithResources({ TimePeriod: { Start: "2026-07-01", End: "2026-07-14" }, Granularity: "DAILY", Filter: { Dimensions: { Key: "SERVICE", Values: ["Amazon Elastic Compute Cloud - Compute"] } }, Metrics: ["UnblendedCost"],});