DescribeBudget
Source:
src/AWS/Budgets/DescribeBudget.ts
Runtime binding for budgets:ViewBudget via DescribeBudget.
Bind this operation to a Budget to read its definition and — most
usefully at runtime — its CalculatedSpend (actual and forecasted spend so
far in the period), e.g. for a cost kill-switch or a spend dashboard.
Provide the implementation with
Effect.provide(AWS.Budgets.DescribeBudgetHttp).
Reading Budget Spend
Section titled “Reading Budget Spend”// init — bind the operation to the budgetconst describeBudget = yield* AWS.Budgets.DescribeBudget(budget);
// runtimeconst { Budget: b } = yield* describeBudget();const actual = Number(b?.CalculatedSpend?.ActualSpend?.Amount ?? "0");const limit = Number(b?.BudgetLimit?.Amount ?? "0");const overBudget = limit > 0 && actual >= limit;