Skip to content

Model: multi-resource / multi-region targeting (UnifiedConfig assumes one provider = one target) #185

Description

@gfargo

Split out of the #156 roadmap spike (Tier 3: model extension). Blocks AWS WAF and GCP Cloud Armor.

Problem

UnifiedConfig assumes a single provider instance targets a single resource:

// src/lib/types/common.ts
export interface ProvidersConfig {
  vercel?: { projectId?: string; teamId?: string }
  cloudflare?: { zoneId?: string; accountId?: string }
}

One zone, one project. That's correct for Cloudflare and Vercel. It does not fit:

  • AWS WAF — a WebACL exists in a scope (CLOUDFRONT or REGIONAL), is region-bound for REGIONAL, and attaches to N resource ARNs (ALBs, API Gateway stages, AppSync APIs). Managing "the same ruleset across 3 regions and 6 load balancers" is the normal case, not an edge case.
  • GCP Cloud Armor — a security policy attaches to N backend services.

Every command also assumes one target implicitly: sync writes to one place, diff compares against one place, status reports one version.

Open design questions (resolve before implementing)

  1. One config, N targets — or N configs? Does a single .doorman.json describe a ruleset applied to many resources, or does doorman stay one-config-one-target and leave fan-out to the user/CI? The former is much more useful and much more work.
  2. Partial failure semantics. If a sync succeeds on 4 of 6 targets, what does SyncResult report? The existing errors[]/success shape (from fix: stop Vercel sync from corrupting rules and discarding real errors #166) is a reasonable starting point but was designed for per-rule failures, not per-target.
  3. Drift across targets. If targets diverge (someone hand-edited one), what do diff/status show? Per-target output, or a merged view with divergence called out?
  4. Does version still mean anything? SyncResult.version / metadata.version assume one authoritative remote version.

Recommendation

Do not build this speculatively. It's the single largest interface change in the #156 roadmap and its right shape depends heavily on which provider lands first. Sequence it with the AWS WAF or GCP epic — whichever is prioritized — rather than ahead of both. Filed now so the constraint is visible when scoping those.

If Fastly is chosen as the first third adapter (recommended in the roadmap — it's structured-JSON and roughly Vercel-sized), this issue is not on the critical path.

Acceptance criteria

To be defined once question 1 is settled. At minimum: a config can target multiple resources, and sync/diff/status report per-target outcomes without pretending partial success is total success.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions