Skip to main content

stackless_integrations/providers/cloudflare/
mod.rs

1//! Cloudflare catalog resources via Stripe Projects.
2//!
3//! Each resource (R2, KV, D1, Queues, Hyperdrive, Workers, Workers AI, Browser
4//! Run) is a generic [`crate::resource::CatalogResource`] with
5//! `PROVIDER_PREFIX = "CLOUDFLARE"`: a distinct `provider = "cloudflare-<svc>"`,
6//! its own `CatalogService` reference (`cloudflare/<service_id>`), and declared
7//! `OUTPUT_FIELDS`. The provision/observe/destroy lifecycle and credential
8//! resolution are shared in `crate::resource`. Output envelopes are pinned by
9//! live discovery (`xtask discover cloudflare/<svc>`) + the smoke.
10//!
11//! Excluded: `containers` (paid, "pricing unavailable" — unknown cost),
12//! `registrar:domain` (a one-time non-refundable domain purchase), and the
13//! `workers:free`/`workers:paid` plans. Cloudflare Workers as a *deploy*
14//! substrate (`--on cloudflare`) is a separate build.
15
16pub mod browser_run;
17pub mod d1;
18pub mod hyperdrive;
19pub mod kv;
20pub mod queues;
21pub mod r2;
22pub mod workers;
23pub mod workers_ai;
24
25// Backwards-compatible names for the resource files (the lifecycle is generic).
26pub(crate) use crate::resource::{
27    CatalogResource as CloudflareResource, int_required, integration_config, interp_optional,
28    interp_required,
29};
30
31/// The Workers family (Workers, Workers AI, Browser Run) provisions the same
32/// account-level Workers enablement and so shares one output envelope, confirmed
33/// by live discovery 2026-06-16. The three stay distinct types (each has its own
34/// `provider` / `RESOURCE_KIND` / catalog reference) but reference these.
35pub(crate) const WORKERS_FAMILY_OUTPUT_FIELDS: &[(&str, &str, bool)] = &[
36    ("ACCOUNT_ID", "account_id", true),
37    ("WORKERS_DEV_SUBDOMAIN", "workers_dev_subdomain", true),
38    ("API_BASE_URL", "api_base_url", false),
39    ("DASHBOARD_URL", "dashboard_url", false),
40    ("PLAN_SERVICE_ID", "plan_service_id", false),
41];
42
43pub(crate) const WORKERS_FAMILY_OUTPUTS: &[&str] = &[
44    "account_id",
45    "workers_dev_subdomain",
46    "api_base_url",
47    "dashboard_url",
48    "plan_service_id",
49];