Skip to content

Pseudo-parameters

Pseudo-parameters stand in for values that vary by environment. Reference them instead of hard-coding, and the serializer resolves each from an environment variable at build time.

Pseudo-parameterEnvironment variableFallback
Fly.RegionFLY_REGIONiad
Fly.OrgSlugFLY_ORG, then FLY_ORG_SLUGpersonal
Fly.AppNameFLY_APP_NAMEapp
import { App, Machine, MachineConfig, MachineGuest, Fly } from "@intentius/chant-lexicon-fly";
const app = new App({ name: "my-app", org_slug: Fly.OrgSlug });
const web = new Machine({
region: Fly.Region,
config: new MachineConfig({
image: "flyio/hellofly:latest",
guest: new MachineGuest({ cpu_kind: "shared", cpus: 1, memory_mb: 256 }),
}),
});

With FLY_REGION=lhr set, region serializes to "lhr"; unset, it falls back to "iad".