Cloudflare/billing
@swamp/cloudflare/billingv2026.10.30.1
01README
Cloudflare billing infrastructure models
02Release Notes
- Added: spend-policies
03Behaviors
@swamp/cloudflare/billing/spend-policiesv2026.10.30.1spend-policies.ts
Global Arguments
| Argument | Type | Description |
|---|---|---|
| account_id | string | Cloudflare account ID |
| action? | enum | The 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? | boolean | Whether the policy is evaluated. |
| name? | string | Display 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? | string | Email 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? | enum | The 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? | number | The spend threshold for the current billing period, in US cents. Must be greater than zero. |
| apiToken? | string | Cloudflare API token; overrides the CLOUDFLARE_API_TOKEN environment variable. Wire with a vault.get(...) expression to source it from a vault. |
| apiKey? | string | Cloudflare 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? | string | Cloudflare 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
| Argument | Type | Description |
|---|---|---|
| id | string | The 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
| Argument | Type | Description |
|---|---|---|
| allowMissing? | boolean | Succeed 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
| Argument | Type | Description |
|---|---|---|
| id | string | The ID of the Spend-policies to import |
fn update(identifier?: string)
Update Spend-policies attributes
| Argument | Type | Description |
|---|---|---|
| identifier? | string | Target a specific Spend-policies by id (e.g. one discovered by list) |
fn delete(id: string)
Delete the Spend-policies
| Argument | Type | Description |
|---|---|---|
| id | string | The ID of the Spend-policies |
fn sync(identifier?: string)
Sync Spend-policies state from Cloudflare
| Argument | Type | Description |
|---|---|---|
| identifier? | string | Target 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