Skip to main content

Cloudflare/billing

@swamp/cloudflare/billingv2026.10.30.1· AGPL-3.0-or-later· 1d agoBEHAVIORS
01README

Cloudflare billing infrastructure models

02Release Notes
  • Added: spend-policies
03Behaviors1
@swamp/cloudflare/billing/spend-policiesv2026.10.30.1spend-policies.ts

Global Arguments

ArgumentTypeDescription
account_idstringCloudflare account ID
action?enumThe action taken when the threshold is reached. `notification` sends an email to `notification_email`. `usage_block` blocks further usage of the product until the end of the billing period. Raising the threshold above the current balance, disabling the policy, or deleting it lifts the block early.
enabled?booleanWhether the policy is evaluated.
name?stringDisplay name of the policy. After surrounding whitespace is trimmed, it must be 1 to 200 bytes long. The value is stored as sent, untrimmed.
notification_email?stringEmail address that receives notifications. Required when `action` is `notification`. When set, it must be a bare address (`user@example.com`); display-name forms such as `Name <user@example.com>` are rejected.
product_id?enumThe product the policy applies to: `workers` or `durable_objects`. Each product's balance and policies are separate. Both products support `notification` and `usage_block` policies on create and update.
threshold_cents?numberThe spend threshold for the current billing period, in US cents. Must be greater than zero.
apiToken?stringCloudflare API token; overrides the CLOUDFLARE_API_TOKEN environment variable. Wire with a vault.get(...) expression to source it from a vault.
apiKey?stringCloudflare API key for the legacy key+email auth path; overrides the CLOUDFLARE_API_KEY environment variable. Wire with a vault.get(...) expression. Requires email.
email?stringCloudflare account email for the legacy key+email auth path; overrides the CLOUDFLARE_EMAIL environment variable. Requires apiKey.
fn create()
Create a Spend-policies
fn get(id: string)
Get a Spend-policies
ArgumentTypeDescription
idstringThe ID of the Spend-policies
fn lookup(allowMissing?: boolean)
Look up an existing Spend-policies by matching global argument values and import it into state
ArgumentTypeDescription
allowMissing?booleanSucceed and record found: false in lookupResult when nothing matches, instead of failing
fn adopt(id: string)
Import an existing Spend-policies by ID into state for management
ArgumentTypeDescription
idstringThe ID of the Spend-policies to import
fn update(identifier?: string)
Update Spend-policies attributes
ArgumentTypeDescription
identifier?stringTarget a specific Spend-policies by id (e.g. one discovered by list)
fn delete(id: string)
Delete the Spend-policies
ArgumentTypeDescription
idstringThe ID of the Spend-policies
fn sync(identifier?: string)
Sync Spend-policies state from Cloudflare
ArgumentTypeDescription
identifier?stringTarget a specific Spend-policies by id (e.g. one discovered by list)

Resources

state(infinite)— Spend-policies resource state
lookupResult(infinite)— Outcome of the most recent lookup
04Stats
A
100 / 100
Downloads
0
Archive size
13.0 KB
Verified by Swamp
  • Has README or module doc2/2earned
  • README has a code example1/1earned
  • README is substantive1/1earned
  • Most symbols documented1/1earned
  • No slow types (deprecated)1/1earned
  • Dependencies pass trust audit2/2earned
  • Docs keep secrets in a vault1/1earned
  • Has description1/1earned
  • Platform support declared (or universal)2/2earned
  • License2/2earned
  • Verified public repository2/2earned
05Platforms
06Labels