| title | Your intent repository |
|---|
Grid’s source of truth for what should exist is a Git repository you create and own — the intent remote Core Syncs into inventory.
The public grid-config repository is an example layout — learn from it, copy patterns, open PRs that improve samples. Do not fork it for production and forget ownership.
- Create a new empty repository on the Git host you use (GitHub, GitLab, or another host that speaks Git). Private repos are expected. Where the username, token, and expiry go: Intent repository access.
- Copy a minimal tree from
grid-config(one project, one cloud, one environment, one unit). - Replace every
REPLACE_*/ lab CIDR / account-specific value. - Point Grid at that remote with a clean URL (no token in the URL). Production HTTPS also needs a host username, a host-issued token, and that token’s expiry. SSH uses a deploy key instead. Full steps: Intent repository access.
GRID_GITOPS_REPO_URL=https://git.example.com/<org>/<your-infra-config>.git
GRID_GITOPS_BRANCH=main
GRID_GITOPS_PATH= # empty = repo root (projects/… at top level)
GRID_GITOPS_SYNC_INTERVAL_SEC=600- Sync from Admin → Sources or Infrastructure.
projects/
<project-slug>/
<cloud>/ # aws | gcp | azure | oracle | …
<environment>/ # development | staging | production | custom
<infra-type>/ # vpc | ec2 | gke | …
<unit-name>.json # one deployable unit
archive/ # optional generated Terraform (exit buffer)
Examples from the public sample:
projects/demo-app/aws/production/vpc/example-vpc.json
projects/grid-labs/aws/development/ec2/grid-labs-vm.json
Full rules: Desired-state layout.
| Do | Don’t |
|---|---|
| PR JSON changes; review like application code | Hand-edit the live GRID_CONFIG_ROOT clone and expect it to survive Sync |
| Keep secrets out of JSON (use cloud IAM / secret refs) | Commit long-lived cloud keys |
| One unit ≈ one engine root (Terraform workspace or Kubernetes workload) | Stuff unrelated stacks into a single giant JSON |
Use metadata.dependsOn for cross-unit references |
Assume Grid merges dependent units into one apply |
On Sync, Core:
- Fetches and hard-resets the working tree to
origin/<branch>(tracked files). - Discovers
*.jsonunits under the configured path prefix. - Upserts infrastructure records (create / update / unchanged).
- Marks previously tracked paths that disappeared as
stale— it does not destroy cloud resources.
Details: GitOps sync.