Repository navigation
Description
Goal
Give chant a native GCP apply path — an applier that speaks GCP's REST APIs directly
and is endpoint-overridable, so the same code targets real GCP or the floci-gcp
emulator (:4588). No Terraform, no Kubernetes controller, no Config Connector in
chant's path. This is the GCP twin of the Azure apply path (#707) and the analogue of
AWS's existing cloud-executor.ts.
Reframed 2026-07-07. This issue was originally "substitute controller vs direct
Terraform." Both framings are retired — see "Retired approaches" below. The earlier
comments (Spike 0, scope research) remain as the trail that led here.
The shape: one pattern across all three clouds
A native applier that speaks the cloud's own API, with an endpoint override so it hits
real cloud or an emulator:
- AWS — has this today:
lexicons/aws/src/components/cloud-executor.ts+
apply.ts, pointed byAWS_ENDPOINT_URL. Works against floci already. - Azure — needs it: chant has no Azure apply path: add an Azure applier (per-resource ARM PUT → floci-az / real ARM) #707.
- GCP — needs it: this issue.
Local emulation isn't a special feature — it falls out for free by pointing the applier
at :4588 instead of googleapis.com. And like #707, this also unblocks real GCP
deploys, which chant cannot do today without standing up Config Connector on a cluster.
Why this is the right shape (and floci-gcp makes it easy)
floci-gcp is a plain GCP API server — Java/GraalVM, standalone, not Terraform-
based and not Kubernetes-based (established in #705 research). You point any GCP
client at it via endpoint override. So chant can call it directly over REST, exactly
like cfn-deploy calls floci for AWS. floci-gcp was never the blocker; chant applying
through Config Connector was.
What to build
- A GCP applier/executor (analogue of
lexicons/aws/src/components/cloud-executor.tsapply.ts), in the gcp lexicon behind the capability seam:
- Consume chant's GCP resources and the lifecycle change-set
(packages/core/src/lifecycle/change-set.ts— create/update/delete/adopt already
classified) in dependency order (the graph already provides it). - Call the GCP REST APIs per resource; poll long-running operations; resolve
references; capture outputs. - Endpoint override (per-service, à la
CLOUDSDK_API_ENDPOINT_OVERRIDES_*/ SDK
apiEndpoint) so it targetsfloci-gcp:4588or realgoogleapis.com— the GCP
analogue ofAWS_ENDPOINT_URL.
- A GCP deploy Op composing
build → apply → wait, mirroring the AWS deploy Ops.
The catch (GCP-specific, be honest about it)
AWS and Azure each have a native deployment orchestrator the applier delegates to
(CloudFormation; ARM az deployment). GCP does not — Deployment Manager is
deprecated/retired. So a GCP applier can't hand a template to one deploy API; it must do
per-resource CRUD across the ~17 service APIs itself, with LRO polling and reference
resolution. In effect: be your own Config Connector, minus Kubernetes. Real work,
bounded to the services floci-gcp emulates + demo-relevant kinds. This is why GCP is
more work than AWS or Azure here.
Retired approaches (do not pursue)
- Terraform (
chant → TF → floci-gcp). Off-thesis: a third-party engine, HCL as an
intermediate language, and a state file — the exact things chant positions against —
and it would make GCP the only cloud where chant doesn't emit/apply natively. floci-gcp
is TF-independent anyway; Terraform was just the easiest off-the-shelf client, never a
requirement. - A Kubernetes substitute controller (an operator on k3d watching CNRM CRDs). Re-
introduces a running operator + cluster dependency chant avoids; chant's model is
plan-then-apply on demand, not continuous reconcile. Only revisit if a live
kubectl-reconcile UX becomes a goal in its own right. - Pointing real Config Connector at floci-gcp. Ruled out by Spike 0 (no endpoint
override; HTTPS/TLS). See the Spike 0 comment.
Reuse / relationships
- Reuses
lifecycle/change-set.ts+ the dependency graph; mirrors AWS
cloud-executor.ts/apply.tsas the pattern. - GCP twin of the Azure apply path (chant has no Azure apply path: add an Azure applier (per-resource ARM PUT → floci-az / real ARM) #707); both are the "native applier + endpoint
override" the AWS lexicon already has. - Depends on nothing in Native local-deploy targets: AWS (floci) + vanilla k8s (k3d) as Ops #704, but shares the endpoint-override precedent.
Acceptance criteria
- A GCP applier deploys a small stack (e.g. a Storage bucket + one dependent
resource) to floci-gcp over REST — create/update/delete in dependency order, LROs
handled. - Endpoint override proven: the same applier targets real GCP (with creds) and
floci-gcp:4588with only an endpoint/config change. - A GCP deploy Op composes
build → apply → waitvia the local executor. - Scoped to floci-gcp's emulated services + demo kinds; unsupported kinds documented.
Out of scope
- Emitting Terraform/Pulumi/Crossplane, or a k8s reconcile controller (retired above).
- Making real Config Connector target an emulator (Research: local-deploy feasibility for Azure (floci-az) + GCP (floci-gcp) #705, Spike 0).
- The browser/WASM sandbox (parked).
Activity
lex00 commentedon Jul 7, 2026
Scope + external-value research (2026-07-07)
Real scoping of the two options, plus a new cheaper spike and the "who benefits outside chant" analysis.
Foundation is validated upstream (de-risks Option B)
compatibility-tests/compat-terraform/(Terraform, Google provider) andcompat-opentofu/, withmain.tf/provider.tf, bats tests, acompatibility.ymlworkflow,just test-terraform. README: "Point your GCP SDK, gcloud CLI, Terraform, or test suite athttp://localhost:4588."{{service}}_custom_endpoint(e.g.compute_custom_endpoint,storage_custom_endpoint), documented explicitly for "GCP-like APIs such as the Cloud Functions emulator." Best-effort, per-service.CNRM ↔ Terraform mapping is real but partial
cnrm.cloud.google.com/tf2crd:"true"(generated from the TF google provider),dcl2crd:"true"(DCL), and newer Direct controllers (hand-written Go, no label). Google is migrating kinds TF/DCL → Direct.tf2crdkinds are ~1:1 with TF resources (mechanical translation); Direct-only kinds have no TF equivalent. A CNRM→TF path scopes cleanly totf2crd-labeled kinds and documents the rest as unsupported-locally. The labels make the supported set detectable.New cheaper spike (do this first)
Config Connector has a Terraform-backed controller mode that runs the google provider internally. Sharpened question: can CC's TF controller be given
*_custom_endpoint→ floci-gcp? If yes, point real CC at the emulator with config and build nothing.Revised scope per option
tf2crdkinds) + templating the provider block's*_custom_endpointat :4588. Bounded to sandbox-relevant, TF-mappable kinds.resourceRef). Bounded to floci-gcp's ~17 services + demo kinds.Upsides OUTSIDE chant (the point of this pass)
compat-terraform/service handlers upstream.Recommendation
tf2crdkinds.Sources
compatibility-tests/compat-terraform,compat-opentofu)lex00 commentedon Jul 7, 2026
Spike 0 result — can real Config Connector target floci-gcp? NO (2026-07-07)
Checked CC's endpoint-override surface directly:
custom_endpoint, providerBasePath/host override,GOOGLE_CLOUD_ENDPOINTenv → 0 hits inGoogleCloudPlatform/k8s-config-connector. CC exposes no provider custom-endpoint config.*.googleapis.comresolve elsewhere). Not a config — and worse here because CC speaks HTTPS togoogleapis.com, so targetinghttp://localhost:4588also needs TLS interception (inject a trusted CA into the CC pod + an HTTPS front for floci-gcp). Fragile hack, not supported.Verdict: the "build nothing" shortcut is dead. Real CC cannot be pointed at the emulator. Option A must be a substitute controller; Option B (direct Terraform) stands. A-vs-B framing confirmed.
[-]Local GCP deploys against floci-gcp: substitute controller vs direct Terraform[/-][+]chant has no native GCP apply path: add a GCP applier (direct REST → floci-gcp / real GCP)[/+]lex00 commentedon Jul 7, 2026
Reframed: retired the substitute-controller and direct-Terraform framings. The native shape is a GCP applier — direct REST to floci-gcp/real GCP, endpoint-overridable — the GCP twin of the Azure apply path (#707) and analogue of AWS's
cloud-executor.ts. Terraform is off-thesis (third-party engine + state file + only non-native cloud); a k8s controller re-introduces an operator chant avoids; real Config Connector was ruled out by Spike 0. Prior comments kept as the research trail.lex00 commentedon Jul 8, 2026
Scoped a starter — one
StorageBucketapplied to floci-gcp end-to-end, establishing the kind→mapper→REST dispatch seam: #711. Demonstrable locally now (floci-gcp is a plain GCS REST server). Later resources are additive mappers on the same seam.feat(op): GCP applier starter — StorageBucket → GCS REST (#711) (#712)
lex00 commentedon Jul 8, 2026
✅ Starter shipped — #711 (#712 merged). The
kind → mapper → RESTdispatch seam is established and verified end-to-end against floci-gcp (404 → created → 200 → idempotent re-apply).Landed: pure
bucketInsertBodymapper + endpoint/project resolvers + idempotentapplyBucket(injectable http, unit-tested) +gcpApplyactivity (endpoint-overridable) + demo op.Next slices, additive on the same seam:
(cnrm) → RESTentry per CNRM kind) — start with the common ones floci-gcp emulates.resourceRef) + ordered apply.feat(op): generalize GCP applier dispatch + add PubSubTopic (#706) (#713
lex00 commentedon Jul 8, 2026
✅ Slice 2 shipped — #713 (merged). Generalized the starter's one hard-coded path into a
ResourceMapperregistry (kind → REST plan) and added the second kind, PubSubTopic. Verified end-to-end against floci-gcp: bucket + topic both created (labels/retention mapped), both GET 200, idempotent re-apply.Adding a resource type is now one
MAPPERSentry. Remaining: LRO polling (first async resource — GKE/CloudSQL), references/ordering, delete/prune, real-GCP auth.refactor(op): relocate cloud appliers into their lexicons (#706) (#714)
lex00 commentedon Jul 8, 2026
✅ Cloud appliers relocated — #714 (merged). Op activities are no longer centralized in the temporal lexicon:
floci→aws,gcpApply→gcp,azGroupEnsure/Delete→azure, each behind a./op/activitiesexport and loaded on demand by the config-drivenloadActivities(lexicons). k3d stays in temporal (agnostic); sharedsafeHeartbeat/sleepmoved to core so cloud lexicons don't depend on temporal. Verified end-to-end through the loader against floci-gcp. Next applier slices (LRO, references) now land in the gcp lexicon where they belong.feat(op): GCP applier LRO support + Cloud Run (async) — #706 (#715)
lex00 commentedon Jul 8, 2026
✅ Slice 3 shipped — #715 (merged). First async resource: LRO polling.
ResourceMappergained an optionaloperation(OperationSpec);longRunningOperation(version)is a reusable poller for the standard google.longrunning pattern;applyResourcepolls async creates to done viawaitForOperation. Added Cloud Run (RunService). Verified live against floci-gcp (async create → operation polled → error path surfaced correctly).Applier now covers: sync CRUD (StorageBucket, PubSubTopic) + async/LRO (RunService). Adding a kind is one
MAPPERSentry (+operationif async). Remaining: more kind mappers (GKE, Cloud SQL — reuse longRunningOperation), references/ordering, delete/prune.feat(op): GCP applier delete (gcpDelete) — #706 (#716)
3 remaining items
feat(op): GCP applier references + dependency ordering — #706 (#718)
lex00 commentedon Jul 8, 2026
✅ Slice 6 shipped — #718 (merged). References + dependency ordering:
referencedNamesextracts CNRM*Refnames,orderByReferencestopologically sorts (apply in dep order, delete in reverse, cycle-detecting). AddedPubSubSubscription(resolvestopicRef→ topic path). Verified live against floci-gcp: a manifest listing the subscription before its topic is reordered (topic → subscription) and the ref resolves.Applier now: full CRUD (create/update/delete, sync + async LRO) + dependency ordering + reference resolution, on one
kind→mapper→RESTseam. Remaining: more kind mappers (GKE/Cloud SQL), Pub/Sub update (updateMask), owned-only prune vs live state.feat(op): GCP applier owned-only prune — #706
feat(op): GCP applier owned-only prune — #706 (#719)
lex00 commentedon Jul 8, 2026
✅ Slice 7 shipped — #719 (merged). Owned-only prune: mappers stamp
managed-by: chant;gcpApply({prune:true})lists chant-owned live resources per kind and deletes those dropped from the manifest, never touching foreign resources. Verified live against floci-gcp: apply [a,b] → apply [a] --prune deletes b (404), keeps a, leaves a foreign bucket (200).Applier is now a complete declarative reconciler: create/update/delete (sync + async LRO), dependency ordering + reference resolution, and owned-only prune — all on one
kind→mapper→RESTseam, endpoint-overridable to real GCP or floci-gcp. (Note: gcp lexicon has its own tsc build gate thatjust builddoesn't run — build the lexicon locally for gcp changes.)feat(op): GCP applier Pub/Sub topic update (updateMask) — #706 (#720)
lex00 commentedon Jul 8, 2026
✅ Slice 8 shipped — #720 (merged). Pub/Sub topic update (updateMask): PubSubTopic reconciles in place via the
{topic, updateMask}envelope, so update is now uniform across StorageBucket, RunService, and PubSubTopic. Verified live against floci-gcp (retention 86400s→3600s).Applier capability matrix is complete: create/update/delete (sync + async LRO), dependency ordering + reference resolution, owned-only prune — across StorageBucket, PubSubTopic, PubSubSubscription, RunService. Remaining is pure resource breadth (more MAPPERS entries: GKE/Cloud SQL/Secret Manager/etc., each reusing the seam).
feat(op): GCP applier — Secret Manager + IAM service account mappers (#…
lex00 commentedon Jul 8, 2026
✅ Slice 9 shipped — #721 (merged). Resource breadth: added
SecretManagerSecret(stamped, list+prune, label update) andIAMServiceAccount(create/idempotent by derived email; no labels → no prune). Verified live on floci-gcp.Applier coverage: StorageBucket, PubSubTopic, PubSubSubscription, SecretManagerSecret, IAMServiceAccount (sync) + RunService (async/LRO) — full CRUD, dependency ordering, reference resolution, owned-only prune. Each additional kind is one MAPPERS entry. Heavy async kinds (GKE ContainerCluster, Cloud SQL) remain but are Docker-backed on floci-gcp so E2E is heavier.
feat(op): azApply — direct ARM-resource applier for floci-az / real A…
feat(examples): local-cloud-trio — consistent cross-cloud local deploy (
lex00 commentedon Jul 8, 2026
✅ Consistent cross-cloud example shipped — #723 (merged).
examples/local-cloud-trio: the same object store deployed to AWS, Azure, and GCP, each on a local emulator, one op per cloud (nativeApply/Floci, azApply/floci-az, gcpApply/floci-gcp). Verified: all 3 stacks synthesize; the built gcp/azure stacks apply end-to-end (bucket + storage account GET 200).This is the payoff of the #706 applier work — chant deploying the same infra to all 3 clouds locally, no accounts. All three clouds now have a native local applier: AWS (Floci/CloudFormation), GCP (floci-gcp/gcpApply, full CRUD+ordering+refs+prune), Azure (floci-az/azApply, direct ARM CRUD).
lex00 commentedon Aug 2, 2026
Shipped in 0.15.0 and verified today against a current
floci/floci-gcp:latest. Closing.Cluster-free direct REST as this issue asked for:
gcp-apply.tsmaps each resource to its own GCP REST call (POST /storage/v1/b?project=…to create,PATCHto update), with no Config Connector and no kubectl anywhere in the apply path.Worth noting for #1209, since it is the same lexicon: the read path has not made this move. Both
describe-resources.tsanddeep-observe.tsstill go through Config Connector over kubectl, so GCP currently applies cluster-free and observes through a cluster.feat(gcp): observe on the applier's transport, not through a cluster (#…