Documentation
Everything needed to deploy, configure, and operate the Monster Cloud multi-tenant migration platform — from a first docker compose up to reading the evidence ledger after a live cutover.
01Overview
Monster Cloud is an autonomous, policy-gated migration platform that moves workloads between AWS, GCP, Azure, OVHcloud, Kubernetes, and on-premises infrastructure — discovery through cutover — without hand-rolled scripts.
Every migration follows the same pipeline: discovery → planning → policy validation → execution → data transfer → cutover → evidence. The planner normalises source infrastructure into a canonical resource graph, translates each resource to a target-provider equivalent with a confidence score, orders the migration by dependency, and estimates blast radius before anything runs.
Provider coverage
EC2, RDS, S3, VPC, EKS, IAM, Security Groups — full live discovery and execution
Compute Engine, Cloud SQL, GCS, GKE, VPC Networks, Service Accounts
VMs, SQL, Blob Storage, AKS, VNets, NSGs, Managed Identities
Instances, object storage, Kubernetes, networks
Workloads, namespaces, ingresses, persistent volumes
FAS/AFF, Cloud Volumes ONTAP, FSx for ONTAP, Azure NetApp Files, GCNV, StorageGRID
02Architecture
The Cloud edition ships as a stateless API, a background worker, and a static UI, backed by Postgres and Redis. Every component is horizontally scalable once two shared secrets are in place.
| Component | Role | Notes |
|---|---|---|
| cmd/api | Stateless HTTP API | Auth, planning, policy gate, marketplace, billing meters |
| cmd/worker | Background execution | Runs migrations; writes a liveness heartbeat every 30s |
| Postgres | System of record | Projects, plans, executions, evidence, org tree, billing |
| Redis | Distributed rate limiting | Required once you run more than one API pod |
| Temporal optional | Durable long-running workflows | OSS self-hosted or Temporal Cloud; in-process without it |
| ui/ | Static single-page app | Same-origin with the API, or behind a reverse proxy |
Tenant isolation
Every request resolves its tenant from the authenticated context (JWT claims + service-token-verified headers) — never from a client-supplied parameter. Reads and executions are additionally scoped with an ownership guard (guardExecutionAccess, guardProjectAccess) before any resource is returned. See Security & Audit for the hardening history behind this guarantee.
03Quick Start
Single-machine stack: Postgres, Redis, and the API. Migrations run automatically on boot.
# 1. copy the environment template cp .env.example .env # 2. edit .env — at minimum set JWT_SECRET # 3. bring the stack up docker compose up -d # 4. confirm the API is ready curl http://localhost:8080/readyz
Once readyz returns 200, open the UI (served on the same origin, or via reverse proxy) and sign in — or run a headless smoke test with make smoke.
04Production Checklist
Five things a single-node dev stack doesn't need but a real deployment does.
-
Generate a stable Ed25519 signing key
Every pod signs evidence artifacts. Without a shared key, artifacts written by pod A can't be verified by pod B.
go run ./cmd/api --gen-key # → ED25519_PRIVATE_KEY=<base64 32-byte seed> # add the same value to every pod's environment
-
Point rate limiting at Redis
Without
REDIS_URL, each pod keeps its own limiter — effective throughput becomesRATE_LIMIT_RPS × pod countinstead of a real per-tenant ceiling.REDIS_URL=redis://your-redis-host:6379/0
Redis Cluster and Sentinel URLs both work. Use
allkeys-lrueviction — rate-limit keys are short-lived and safe to evict under pressure. -
Size the database connection pool
Default is 25 max-open / 5 idle. For a managed Postgres capped at 100 connections, leave headroom for migrations and monitoring:
PGMAXCONNS=20 PGMAXIDLE=5
-
Set a real JWT secret
openssl rand -base64 32
-
Choose the execution mode deliberately
previewplans commands but issues no cloud API calls — the safe default.applyexecutes real operations against AWS/GCP/Azure/OVH/K8s and requires the matching cloud credentials to be set.PROVIDER_EXECUTION_MODE=preview # default PROVIDER_EXECUTION_MODE=apply # executes real operations
05Kubernetes Deployment
With REDIS_URL and ED25519_PRIVATE_KEY both set, the API is fully stateless and safe to run behind an HPA.
# k8s Deployment env block
env:
- name: DATABASE_URL
valueFrom: { secretKeyRef: { name: cm-secrets, key: database-url } }
- name: REDIS_URL
valueFrom: { secretKeyRef: { name: cm-secrets, key: redis-url } }
- name: JWT_SECRET
valueFrom: { secretKeyRef: { name: cm-secrets, key: jwt-secret } }
- name: ED25519_PRIVATE_KEY
valueFrom: { secretKeyRef: { name: cm-secrets, key: ed25519-key } }
- name: PROVIDER_EXECUTION_MODE
value: "preview"
livenessProbe:
httpGet: { path: /healthz, port: 8080 }
initialDelaySeconds: 5
readinessProbe:
httpGet: { path: /readyz, port: 8080 }
initialDelaySeconds: 10
Manifest layout
| File | Purpose |
|---|---|
| 00-namespace-secrets.yaml | Namespace + secret objects |
| 01-configmap.yaml | Non-secret runtime configuration |
| 02-api-deployment.yaml | Stateless API pods |
| 03-worker-deployment.yaml | Execution worker — requires the heartbeat file below |
| 04-hpa-ingress.yaml | Horizontal autoscaling + ingress rules |
| 05-cronjob-prune.yaml | Scheduled cleanup of stale state |
| 06-network-policy.yaml | Pod-to-pod traffic restrictions |
| 07-database-scalability.yaml | Postgres scaling knobs |
/tmp/worker-heartbeat was written in the last 120 seconds. The worker binary writes it at startup and every 30s — if you fork or replace cmd/worker/main.go, keep that write loop or the pod will crash-loop under kubelet.06Configuration Reference
Every environment variable the API reads, and what happens if you leave it unset.
| Variable | Required | Default | Notes |
|---|---|---|---|
| DATABASE_URL | required | postgres://migrator:migrator@db:5432/migrator | Postgres DSN |
| JWT_SECRET | required (prod) | — | HMAC-SHA256 key for token verification |
| ED25519_PRIVATE_KEY | required (multi-pod) | ephemeral | Base64 32-byte seed — identical on every pod |
| REDIS_URL | required (multi-pod) | — | Falls back to in-process limiting without it |
| PROVIDER_EXECUTION_MODE | optional | preview | preview or apply |
| PORT | optional | 8080 | HTTP listen port |
| MIGRATE_ON_STARTUP | optional | true | Run DB migrations on boot |
| RATE_LIMIT_RPS | optional | 20 | Per-tenant requests/second |
| RATE_LIMIT_BURST | optional | 40 | Per-tenant burst above RPS |
| PGMAXCONNS | optional | 25 | Max DB connections per pod |
| PGMAXIDLE | optional | 5 | Max idle DB connections per pod |
| AWS_REGION | optional | us-east-1 | Default region for AWS execution |
| GCP_PROJECT_ID | optional | — | GCP project for execution |
| AZURE_SUBSCRIPTION_ID | optional | — | Azure subscription for execution |
| NETAPP_ENDPOINT / NETAPP_USERNAME / NETAPP_PASSWORD / NETAPP_API_TOKEN | optional | — | ONTAP REST credentials — read only from the environment, never from plan metadata |
apply mode. In preview mode (the default), no outbound cloud API calls are made — safe to run with none of the AWS/GCP/Azure/NetApp variables set.07API Endpoints
The core migration lifecycle, one endpoint per stage.
| Method | Path | Purpose |
|---|---|---|
| POST | /v1/projects | Create a migration workspace |
| POST | /v1/discovery/import/aws-snapshot | Import a discovery snapshot |
| POST | /v1/migrations/plan | Generate a migration plan |
| POST | /v1/migrations/prepare-execution | Run the policy gate, return approval requirements + rollback checkpoints |
| POST | /v1/migrations/execute | Execute an approved plan |
| POST | /v1/migrations/rollback | Roll back an execution |
| POST | /v1/migrations/pipeline/aws-to-gcp | Discovery → plan → execute in one call |
| POST | /v1/migrations/preflight | Pre-flight validation before execution |
| POST | /v1/migrations/cutover | Trigger DNS / traffic cutover |
| GET | /readyz | Readiness probe |
| GET | /healthz | Liveness probe |
Example — preparing an execution
curl -X POST https://api.monstercloud.io/v1/migrations/prepare-execution \ -H "Authorization: Bearer $TOKEN" \ -H "Content-Type: application/json" \ -d '{"planId":"pln_9f2a"}'
The response carries the execution package, an approval request when policy requires human review, the ordered action IDs, and a rollback checkpoint per action.
08Data Migration Engines
The planner selects a transfer engine per resource pair automatically.
| Resource | Target | Engine | |
|---|---|---|---|
| PostgreSQL | GCP | gcloud database-migration migration-jobs | |
| PostgreSQL | AWS | aws dms create-replication-task | |
| PostgreSQL | Azure | az dms project task create | |
| PostgreSQL | Any | pg_dump / pg_restore | |
| MySQL | Any | mysqldump | |
| S3 Bucket | GCP | gsutil -m rsync -r -d | |
| S3 Bucket | AWS | aws s3 sync --delete | |
| S3 Bucket | Azure | azcopy sync --recursive | |
| Filesystem | Any | rsync -avz | |
| NetApp volume | NetApp (any deployment) | SnapMirror | |
| NetApp volume | Non-ONTAP | XCP |
NetApp-to-NetApp transfers use SnapMirror even across hyperscalers, because AWS FSx for ONTAP, Azure NetApp Files, and Google Cloud NetApp Volumes all speak the same first-party ONTAP replication protocol — this is the one migration path with a 0.97 translation confidence score.
09Dashboard & Projects
Everything starts with a project — a per-tenant migration workspace.
Dashboard
Four stat tiles — Projects, Discovery Runs, Plans, Executions — plus two forms: New Project (tenant ID + project name) and Quick Plan (project, target provider, autonomy level 0–5) for going from zero to a dry-run plan in one screen.
Projects
The full list of migration workspaces for the current tenant. Each project scopes its own discoveries, plans, executions, and evidence — nothing crosses tenant boundaries by default.
10Discovery & Plans
Discovery
Import a snapshot (e.g. aws-snapshot) or trigger a live scan against a connected account. Discovery normalises everything found into the canonical resource graph — compute, storage, network, and (with NetApp connected) file/block volumes and SVMs.
Plans
Generate a dry-run plan from a discovery run: dependency-ordered actions, a translation confidence score per resource, and an estimated blast radius / downtime class. Nothing here touches real infrastructure.
Translation confidence — AWS → GCP
| AWS resource | GCP target | Confidence |
|---|---|---|
| S3 Bucket | GCS Bucket | 0.96 |
| VPC | Compute Network | 0.94 |
| Subnet | Subnetwork | 0.90 |
| EC2 Instance | Compute Engine VM | 0.84 |
| RDS Postgres | Cloud SQL | 0.79 |
| EKS Cluster | GKE Cluster | 0.74 |
| Security Group | Firewall Rules | 0.71 |
| IAM Role | Service Account | 0.48 · manual review |
11Execute, Pipeline & Cutover
Execute
Runs an approved, policy-gated plan. In preview mode, actions are simulated end-to-end with no external calls; in apply mode, the bound provider executor issues real operations and polls until each step settles.
Pipeline
Runs discovery → plan → execute as a single guided flow for the common case — a straight AWS-to-GCP lift — instead of driving each API call by hand.
Cutover
Zero-downtime traffic switchover once data transfer is complete, via one of four strategies:
- DNS Swap — atomic Route 53 / Cloud DNS / Azure DNS record update
- Weighted Canary — gradual shift via Route 53 weighted routing or Istio
- Load Balancer swap — ELBv2 listener modify / App Gateway backend pool swap
- Service Mesh — Istio/Linkerd VirtualService weight split
12Approvals & Evidence
Approvals
When the policy engine flags an action for review (high blast radius, sensitive resource, out-of-policy region), it lands here as an approval request rather than blocking silently. An approver role signs off before execute proceeds.
Evidence
Every executed command is hashed (SHA-256) and its artifact signed (Ed25519). The evidence ledger is the source of truth for what actually ran, in what order, against which resources — designed to satisfy SOC 2 Type II, ISO 27001, HIPAA, and GDPR change-management controls.
Preflight
A final validation pass immediately before execution — checks credentials, quota, and resource state so a plan doesn't fail midway through a migration window.
Data Migration
Tracks the underlying data-transfer jobs (database replication, object sync, filesystem copy) that back a migration — independent of the infrastructure actions, since data often keeps moving after cutover of compute completes.
Coverage
A system-level view of platform reliability: route and test coverage, and the tenant-isolation drift guard that runs on every build to confirm the cloud and on-prem trees haven't diverged on auth or tenancy code.
13Policy & Autonomy
No plan reaches real infrastructure without passing an OPA-compatible policy engine.
The gate evaluates resource risk level, IAM permission scope, cross-region data transfer rules, compliance-zone restrictions, and the operator's chosen autonomy level. Autonomy is a single dial from 0 to 5:
| Level | Behaviour |
|---|---|
| 0 | Plan only — every action requires manual approval, no exceptions |
| 1–2 | Assisted — low-risk actions auto-approved, everything else queued for review |
| 3–4 | Supervised — most actions proceed automatically; high blast-radius actions still gate |
| 5 | Full autonomy — the plan executes end-to-end once policy passes, no human in the loop |
14Security & Audit
The current release has been through an independent security audit covering both the cloud and on-premise trees plus the Terraform provider.
What the audit covered
Every fix below was proven with an executable test before the change and re-verified after:
- Tenant isolation — request-scoped tenant resolution replaced parameter- and self-comparison-based checks across projects, executions, and plans
- Authentication — service-token verification, JWT expiry enforcement, and token revocation wiring made consistent across both deployment trees
- Storage correctness — the SQLite driver shim and 14 schema migrations now apply completely and identically to Postgres
- Execution reporting — real failures are no longer mislabelled as harmless preview runs
- Concurrency — 200 concurrent goroutines against the idempotency guard, race-detector clean
- Regression guard —
scripts/check_tree_drift.shnow fails CI if the cloud and on-prem auth/tenancy code diverge
math/rand in a security context, no MD5/SHA-1, no InsecureSkipVerify, no hard-coded secrets. Kubernetes manifests already run runAsNonRoot, readOnlyRootFilesystem, and allowPrivilegeEscalation: false.apply-mode execution path (Postgres + Temporal + live cloud CLIs) hasn't been exercised end-to-end, and connector field-mappings for AWS/GCP/OVH/K8s haven't been reviewed with the same rigor as the Azure and NetApp connectors. Treat apply mode against production accounts as needing its own validation pass.15Enterprise Capabilities
Five capabilities that only make sense once the platform is running for many tenants at once.
Meters GB migrated, compute-hours, and executions started against the tenant's plan tier. Enterprise accounts get committed-spend contracts; Free/Starter keep an execution-count gate.
Enterprise → Divisions → Teams → Projects, each with its own tenant isolation and inheritable quotas. Break-glass grants give time-limited (4h default) emergency access with mandatory justification.
Third-party connectors (VMware, Nutanix, SAP, Cloudian…) published via a Plugin SDK. 70/30 revenue split between the author and the platform.
Every execution feeds an anonymised outcome record — predicted vs. actual confidence, blast radius, and downtime — training translation, risk, and anomaly models over time.
A public, no-auth ROI calculator, shareable post-migration reports, and a tiered partner/SI referral program (10–18% commission) drive inbound.
16Runbook & FAQ
/tmp/worker-heartbeat to have been written in the last 120 seconds. Confirm your worker binary still runs the heartbeat write loop on startup and every 30 seconds — a custom or forked cmd/worker that drops this loop will be killed by kubelet roughly two minutes after boot, indefinitely.REDIS_URL. Without it, each API pod enforces its own independent limiter, so the effective ceiling scales with pod count instead of staying fixed per tenant.ED25519_PRIVATE_KEY across pods. Generate one key with go run ./cmd/api --gen-key and set it identically everywhere — an ephemeral per-pod key (the default) can't verify artifacts signed by a different pod.preview mode without a live discovery behind the plan — the NetApp executor validates required fields (SVM, aggregate, size) strictly before issuing any request rather than silently falling back to defaults. Run discovery against a real or simulated ONTAP cluster first so the plan carries real resource metadata.apply mode against a production account?apply path against real AWS/GCP/Azure accounts end-to-end. Start in preview, review the plan and policy decision, then flip to apply on a low-stakes environment first.