Skip to content

DescribeReportDefinitions

Source: src/AWS/CostAndUsageReport/DescribeReportDefinitions.ts

Runtime binding for cur:DescribeReportDefinitions.

Lists the Cost and Usage Report definitions in the account — each entry carries the report’s delivery bucket/prefix, granularity, format, and last delivery status, so a Lambda can discover where its billing data lands before reading the report files from S3. Account-level operation (the API enumerates every definition), so the binding takes no resource argument. Provide the implementation with Effect.provide(AWS.CostAndUsageReport.DescribeReportDefinitionsHttp).

// init — account-level binding, no resource argument
const describeReportDefinitions =
yield* AWS.CostAndUsageReport.DescribeReportDefinitions();
// runtime
const { ReportDefinitions } = yield* describeReportDefinitions();
const report = ReportDefinitions?.find((r) => r.ReportName === "costs");
yield* Effect.log(`delivered to s3://${report?.S3Bucket}/${report?.S3Prefix}`);